소스 검색

unify ident patterns unless they are type expressions (fixed NC Skype issue #31)

Simon Krajewski 12 년 전
부모
커밋
e6347d406e
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      matcher.ml

+ 3 - 3
matcher.ml

@@ -358,7 +358,7 @@ let to_pattern ctx e t =
 		| EConst(Ident s) ->
 			begin try
 				let tc = monomorphs ctx.type_params (t) in
-				let ec = match tc with
+				let ec = match follow tc with
 					| TEnum(en,pl) ->
 						let ef = try PMap.find s en.e_constrs with Not_found when not (is_lower_ident s) -> error ("Expected constructor for enum " ^ (s_type_path en.e_path)) p in
 						let et = mk (TTypeExpr (TEnumDecl en)) (TAnon { a_fields = PMap.empty; a_status = ref (EnumStatics en) }) p in
@@ -368,8 +368,8 @@ let to_pattern ctx e t =
 						ctx.untyped <- true;
 						let e = try type_expr ctx e (WithType tc) with _ -> ctx.untyped <- old; raise Not_found in
 						ctx.untyped <- old;
-						(match tc with
-							| TMono _ -> ()
+						(match e.eexpr with
+							| TTypeExpr _ -> ()
 							| _ -> try unify_raise ctx e.etype tc e.epos with Error (Unify _,_) -> raise Not_found);
 						e
 				in