Răsfoiți Sursa

make sure to register types_module (needed for generics) close #4692

Nicolas Cannasse 9 ani în urmă
părinte
comite
3558853fac
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 3 2
      typeload.ml

+ 3 - 2
typeload.ml

@@ -2774,7 +2774,8 @@ let resolve_typedef t =
 		| _ -> t
 		| _ -> t
 
 
 let add_module ctx m p =
 let add_module ctx m p =
-	Hashtbl.add ctx.g.modules m.m_path m
+	Hashtbl.add ctx.g.modules m.m_path m;
+	List.iter (fun t -> Hashtbl.add ctx.g.types_module (t_path t) m.m_path) m.m_types
 
 
 (*
 (*
 	In this pass, we can access load and access other modules types, but we cannot follow them or access their structure
 	In this pass, we can access load and access other modules types, but we cannot follow them or access their structure
@@ -3263,7 +3264,7 @@ let type_types_into_module ctx m tdecls p =
 *)
 *)
 let type_module ctx mpath file ?(is_extern=false) tdecls p =
 let type_module ctx mpath file ?(is_extern=false) tdecls p =
 	let m = make_module ctx mpath file p in
 	let m = make_module ctx mpath file p in
-	add_module ctx m p;
+	Hashtbl.add ctx.g.modules m.m_path m;
 	type_types_into_module ctx m tdecls p;
 	type_types_into_module ctx m tdecls p;
 	if is_extern then m.m_extra.m_kind <- MExtern;
 	if is_extern then m.m_extra.m_kind <- MExtern;
 	m
 	m