Browse Source

Revert "do not cancel pattern matching if matched enum is empty (closes #2233)"

This reverts commit cf0b823d017058ac56c0bf96a3bb410badffe388.
Simon Krajewski 12 years ago
parent
commit
621d84938f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      matcher.ml

+ 1 - 1
matcher.ml

@@ -1054,7 +1054,7 @@ let match_expr ctx e cases def with_type p =
 		| _ ->
 			let e = type_expr ctx e Value in
 			begin match follow e.etype with
-			| TEnum(en,_) when Meta.has Meta.FakeEnum en.e_meta ->
+			| TEnum(en,_) when PMap.is_empty en.e_constrs || Meta.has Meta.FakeEnum en.e_meta ->
 				raise Exit
 			| TAbstract({a_path=[],("Int" | "Float" | "Bool")},_) | TInst({cl_path = [],"String"},_) when (Common.defined ctx.com Common.Define.NoPatternMatching) ->
 				raise Exit;