소스 검색

unify enum abstract field type with expected type to support GADTish behavior

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

+ 1 - 1
matcher.ml

@@ -414,7 +414,7 @@ let to_pattern ctx e t =
 						mk (TField (et,FEnum (en,ef))) (apply_params en.e_types pl ef.ef_type) p
 					| TAbstract({a_impl = Some c} as a,_) when Meta.has Meta.Enum a.a_meta ->
 						let cf = PMap.find s c.cl_statics in
-						ignore(follow cf.cf_type);
+						Type.unify (follow cf.cf_type) t;
 						let e = begin match cf.cf_expr with
 						| Some ({eexpr = TConst c | TCast({eexpr = TConst c},None)} as e) -> e
 						| _ -> raise Not_found