Skip to content

Commit

Permalink
Treat empty variants as GADTs for exhaustiveness check
Browse files Browse the repository at this point in the history
  • Loading branch information
lpw25 committed Feb 18, 2020
1 parent 6e1fa2a commit 8d03cbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion typing/typecore.ml
Expand Up @@ -1163,7 +1163,9 @@ and type_pat_aux ~exception_allowed ~constrs ~labels ~no_existentials ~mode
let (sp, constrs, labels) =
try
Parmatch.ppat_of_type !env expected_ty
with Parmatch.Empty -> raise (Error (loc, !env, Empty_pattern))
with Parmatch.Empty ->
if mode = Inside_or then raise Need_backtrack
else raise (Error (loc, !env, Empty_pattern))
in
if sp.ppat_desc = Parsetree.Ppat_any then k' Tpat_any else
if mode = Inside_or then raise Need_backtrack else
Expand Down

0 comments on commit 8d03cbb

Please sign in to comment.