Explorar el Código

ensure lazy typedefs are followed eventually

Simon Krajewski hace 9 años
padre
commit
01cc40395e
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  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 ->