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

[macro] type function arguments in macro context

Simon Krajewski 4 жил өмнө
parent
commit
6ae54f52c0

+ 0 - 1
src/macro/macroApi.ml

@@ -21,7 +21,6 @@ type 'value compiler_api = {
 	parse_string : string -> Globals.pos -> bool -> Ast.expr;
 	type_expr : Ast.expr -> Type.texpr;
 	resolve_type  : Ast.complex_type -> Globals.pos -> t;
-	type_macro_expr : Ast.expr -> Type.texpr;
 	store_typed_expr : Type.texpr -> Ast.expr;
 	allow_package : string -> unit;
 	type_patch : string -> string -> bool -> string option -> unit;

+ 1 - 10
src/typing/macroContext.ml

@@ -203,15 +203,6 @@ let make_macro_api ctx p =
 		MacroApi.type_expr = (fun e ->
 			typing_timer ctx true (fun() -> type_expr ctx e WithType.value)
 		);
-		MacroApi.type_macro_expr = (fun e ->
-			let e = typing_timer ctx true (fun() -> type_expr ctx e WithType.value) in
-			let rec loop e = match e.eexpr with
-				| TField(_,FStatic(c,({cf_kind = Method _} as cf))) -> ignore(!load_macro_ref ctx false c.cl_path cf.cf_name e.epos)
-				| _ -> Type.iter loop e
-			in
-			loop e;
-			e
-		);
 		MacroApi.flush_context = (fun f ->
 			typing_timer ctx true f
 		);
@@ -712,7 +703,7 @@ let type_macro ctx mode cpath f (el:Ast.expr list) p =
 			| MAExpr ->
 				Interp.encode_expr e
 			| MAFunction ->
-				let e = ictx.Interp.curapi.MacroApi.type_macro_expr e in
+				let e = type_expr mctx e WithType.value in
 				begin match Interp.eval_expr ictx e with
 				| Some v -> v
 				| None -> Interp.vnull