Skip to content

Commit

Permalink
ocaml#9309 (rewrite 8d03cbb)
Browse files Browse the repository at this point in the history
Treat empty variants as GADTs for exhaustiveness check
  • Loading branch information
stedolan authored and mshinwell committed Aug 19, 2020
1 parent 92a9c37 commit f478721
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion typing/typecore.ml
Expand Up @@ -1182,7 +1182,9 @@ and type_pat_aux ~exception_allowed ~no_existentials ~mode
k' Tpat_any
| Counter_example ({explosion_fuel; _} as info) ->
begin match Parmatch.ppat_of_type !env expected_ty with
| exception Parmatch.Empty -> raise (Error (loc, !env, Empty_pattern))
| exception Parmatch.Empty ->
if must_backtrack_on_gadt then raise Need_backtrack else
raise (Error (loc, !env, Empty_pattern))
| (sp, constrs, labels) ->
if sp.ppat_desc = Parsetree.Ppat_any then k' Tpat_any else
if must_backtrack_on_gadt then raise Need_backtrack else
Expand Down

0 comments on commit f478721

Please sign in to comment.