Переглянути джерело

ensure lazy typedefs are followed eventually

Simon Krajewski 9 роки тому
батько
коміт
01cc40395e
1 змінених файлів з 4 додано та 2 видалено
  1. 4 2
      src/typing/typeload.ml

+ 4 - 2
src/typing/typeload.ml

@@ -3280,11 +3280,13 @@ let init_module_type ctx context_init do_init (decl,p) =
 			if t.t_type == follow tt then error "Recursive typedef is not allowed" p;
 			tt
 		| _ ->
-			TLazy (exc_protect ctx (fun r ->
+			let r = exc_protect ctx (fun r ->
 				if t.t_type == follow tt then error "Recursive typedef is not allowed" p;
 				r := (fun() -> tt);
 				tt
-			) "typedef_rec_check")
+			) "typedef_rec_check" in
+			delay ctx PForce (fun () -> ignore(!r()));
+			TLazy r
 		) in
 		(match t.t_type with
 		| TMono r ->