소스 검색

delay underlying type vs. from/to check (fixed issue #1446)

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

+ 3 - 1
typeload.ml

@@ -1933,7 +1933,9 @@ let rec init_module_type ctx context_init do_init (decl,p) =
 			let t = load_complex_type ctx p t in
 			if not (Meta.has Meta.CoreType a.a_meta) then begin
 				if !is_type then begin
-					(try type_eq EqStrict a.a_this t with Unify_error _ -> error "You can only declare from/to with your underlying type" p);
+					delay ctx PFinal (fun () ->
+						(try type_eq EqStrict a.a_this t with Unify_error _ -> error "You can only declare from/to with your underlying type" p)
+					);
 				end else
 					error "Missing underlying type declaration or @:coreType declaration" p;
 			end;