소스 검색

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

Simon Krajewski 12 년 전
부모
커밋
cf0b823d01
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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 PMap.is_empty en.e_constrs || Meta.has Meta.FakeEnum en.e_meta ->
+			| TEnum(en,_) when 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;