Browse Source

don't force early evaluation for extensions (close #2563)

Nicolas Cannasse 11 years ago
parent
commit
7ed1adb55e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      typeload.ml

+ 4 - 1
typeload.ml

@@ -2410,7 +2410,10 @@ let rec init_module_type ctx context_init do_init (decl,p) =
 		(*
 		(*
 			we exceptionnaly allow follow here because we don't care the type we get as long as it's not our own
 			we exceptionnaly allow follow here because we don't care the type we get as long as it's not our own
 		*)
 		*)
-		if t.t_type == follow tt then error "Recursive typedef is not allowed" p;
+		(match d.d_data with
+		| CTExtend _ -> ()
+		| _ ->
+			if t.t_type == follow tt then error "Recursive typedef is not allowed" p);
 		(match t.t_type with
 		(match t.t_type with
 		| TMono r ->
 		| TMono r ->
 			(match !r with
 			(match !r with