2
0
Эх сурвалжийг харах

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

Nicolas Cannasse 9 жил өмнө
parent
commit
3558853fac
1 өөрчлөгдсөн 3 нэмэгдсэн , 2 устгасан
  1. 3 2
      typeload.ml

+ 3 - 2
typeload.ml

@@ -2774,7 +2774,8 @@ let resolve_typedef t =
 		| _ -> t
 
 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
@@ -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 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;
 	if is_extern then m.m_extra.m_kind <- MExtern;
 	m