summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Bauereiss2019-01-23 14:28:31 +0000
committerThomas Bauereiss2019-01-23 14:31:31 +0000
commit8883d3a5a516e65825ad844a8b985f8be79f4f89 (patch)
tree1c7b126f8ca53330a1a508232a13c41b9bad8e8c /src
parent7ebe7fe5a37959b9004548b4287dbfc1f6faa087 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/type_check.ml7
1 files changed, 7 insertions, 0 deletions
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