Browse Source

fixed wrongly placed dependency add

Nicolas Cannasse 11 years ago
parent
commit
fdd0872a7e
1 changed files with 5 additions and 5 deletions
  1. 5 5
      typeload.ml

+ 5 - 5
typeload.ml

@@ -2342,11 +2342,6 @@ let rec init_module_type ctx context_init do_init (decl,p) =
 let type_module ctx m file tdecls p =
 	let m, decls, tdecls = make_module ctx m file tdecls p in
 	add_module ctx m p;
-	if ctx.g.std != null_module then begin
-		add_dependency m ctx.g.std;
-		(* this will ensure both String and (indirectly) Array which are basic types which might be referenced *)
-		ignore(load_core_type ctx "String");
-	end;
 	(* define the per-module context for the next pass *)
 	let ctx = {
 		com = ctx.com;
@@ -2379,6 +2374,11 @@ let type_module ctx m file tdecls p =
 		opened = [];
 		vthis = None;
 	} in
+	if ctx.g.std != null_module then begin
+		add_dependency m ctx.g.std;
+		(* this will ensure both String and (indirectly) Array which are basic types which might be referenced *)
+		ignore(load_core_type ctx "String");
+	end;
 	(* here is an additional PASS 1 phase, which define the type parameters for all module types.
 		 Constraints are handled lazily (no other type is loaded) because they might be recursive anyway *)
 	List.iter (fun d ->