浏览代码

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
 			let t = load_complex_type ctx p t in
 			if not (Meta.has Meta.CoreType a.a_meta) then begin
 			if not (Meta.has Meta.CoreType a.a_meta) then begin
 				if !is_type 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
 				end else
 					error "Missing underlying type declaration or @:coreType declaration" p;
 					error "Missing underlying type declaration or @:coreType declaration" p;
 			end;
 			end;