From 66c5f1bbe4814fbbf9c78ca91fb35ce0e11a8998 Mon Sep 17 00:00:00 2001 From: Mitya Lyubarskiy Date: Mon, 9 Mar 2020 07:16:41 -0700 Subject: [PATCH] [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 --- infer/src/nullsafe/typeCheck.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/infer/src/nullsafe/typeCheck.ml b/infer/src/nullsafe/typeCheck.ml index c8ac37538..b089195d3 100644 --- a/infer/src/nullsafe/typeCheck.ml +++ b/infer/src/nullsafe/typeCheck.ml @@ -1032,11 +1032,11 @@ let typecheck_sil_call_function find_canonical_duplicate checks tenv instr_ref t let handle_et (e1, t1) (etl1, typestate1) = typecheck_expr_for_errors ~nullsafe_mode find_canonical_duplicate curr_pdesc calls_this checks tenv node instr_ref typestate e1 loc ; - let e2, typestate2 = - convert_complex_exp_to_pvar_and_update_typestate tenv idenv curr_pname - curr_annotated_signature ~node ~original_node:node ~is_assignment:false e1 typestate1 loc + let e2 = + convert_complex_exp_to_pvar tenv idenv curr_pname curr_annotated_signature ~node + ~original_node:node e1 typestate1 loc in - (((e1, e2), t1) :: etl1, typestate2) + (((e1, e2), t1) :: etl1, typestate1) in List.fold_right ~f:handle_et etl ~init:([], typestate) in