From 8883d3a5a516e65825ad844a8b985f8be79f4f89 Mon Sep 17 00:00:00 2001 From: Thomas Bauereiss Date: Wed, 23 Jan 2019 14:28:31 +0000 Subject: Add another flow-typing case for E_internal_plet Copied from a corresponding case for E_block, so that this flow typing still gets picked up after E_block has been rewritten away. --- src/type_check.ml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/type_check.ml b/src/type_check.ml index ddd16eef..11d5e6a0 100644 --- a/src/type_check.ml +++ b/src/type_check.ml @@ -2466,6 +2466,13 @@ let rec check_exp env (E_aux (exp_aux, (l, ())) as exp : unit exp) (Typ_aux (typ Env.add_constraint nc env | None -> env end + | E_aux (E_if (cond, e_t, e_e), _) -> + begin + match unaux_exp (fst (uncast_exp e_t)) with + | E_throw _ | E_block [E_aux (E_throw _, _)] -> + add_opt_constraint (option_map nc_not (assert_constraint env false cond)) env + | _ -> env + end | _ -> env in let checked_body = crule check_exp env body typ in annot_exp (E_internal_plet (tpat, bind_exp, checked_body)) typ -- cgit v1.2.3