Kaynağa Gözat

add std types to module context before calling onGenerate callback (closes #1904)

Simon Krajewski 12 yıl önce
ebeveyn
işleme
bcb5d17d91
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  1. 2 0
      typer.ml

+ 2 - 0
typer.ml

@@ -3410,6 +3410,8 @@ let make_macro_api ctx p =
 		Interp.on_generate = (fun f ->
 			Common.add_filter ctx.com (fun() ->
 				let t = macro_timer ctx "onGenerate" in
+				(* add standard types to current module so basic types can be resolved (issue #1904) *)
+				ctx.m.module_types <- ctx.m.module_types @ ctx.g.std.m_types;
 				f (List.map make_instance ctx.com.types);
 				t()
 			)