Sfoglia il codice sorgente

make sure to finalize context before add_types

Simon Krajewski 13 anni fa
parent
commit
80c5575ea2
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      typer.ml

+ 5 - 1
typer.ml

@@ -2612,7 +2612,11 @@ let make_macro_api ctx p =
 		| TEnumDecl e -> TEnum (e,List.map snd e.e_types)
 		| TTypeDecl t -> TType (t,List.map snd t.t_types)
 	in
-	let add_types () = Hashtbl.iter (fun v m -> Interp.add_types (Interp.get_ctx()) m.m_types) ctx.g.modules in
+	let add_types () =
+		finalize ctx;
+		let l = Hashtbl.fold (fun v m l -> l @ m.m_types) ctx.g.modules ctx.com.types in
+		Interp.add_types (Interp.get_ctx()) l;
+	in
 	{
 		Interp.pos = p;
 		Interp.get_com = (fun() -> ctx.com);