[nullsafe][refactor] Don't modify typestate without a need when typechecking call instruction

Summary:
Experiment show that we did not rely on fact that this function could modify
typestate.

Reviewed By: artempyanykh

Differential Revision: D20285198

fbshipit-source-id: dc20f4b4b
master
Mitya Lyubarskiy 5 years ago committed by Facebook Github Bot
parent cb3a657465
commit 66c5f1bbe4

@ -1032,11 +1032,11 @@ let typecheck_sil_call_function find_canonical_duplicate checks tenv instr_ref t
let handle_et (e1, t1) (etl1, typestate1) = let handle_et (e1, t1) (etl1, typestate1) =
typecheck_expr_for_errors ~nullsafe_mode find_canonical_duplicate curr_pdesc calls_this checks typecheck_expr_for_errors ~nullsafe_mode find_canonical_duplicate curr_pdesc calls_this checks
tenv node instr_ref typestate e1 loc ; tenv node instr_ref typestate e1 loc ;
let e2, typestate2 = let e2 =
convert_complex_exp_to_pvar_and_update_typestate tenv idenv curr_pname convert_complex_exp_to_pvar tenv idenv curr_pname curr_annotated_signature ~node
curr_annotated_signature ~node ~original_node:node ~is_assignment:false e1 typestate1 loc ~original_node:node e1 typestate1 loc
in in
(((e1, e2), t1) :: etl1, typestate2) (((e1, e2), t1) :: etl1, typestate1)
in in
List.fold_right ~f:handle_et etl ~init:([], typestate) List.fold_right ~f:handle_et etl ~init:([], typestate)
in in

Loading…
Cancel
Save