@@ -666,6 +666,7 @@ let rec build_call ?(mode=MGet) ctx acc el (with_type:WithType.t) p =
let ethis_f = ref (fun () -> ()) in
let f = (match ethis.eexpr with
| TTypeExpr (TClassDecl c) ->
+ DeprecationCheck.check_cf ctx.com cf p;
(match ctx.g.do_macro ctx MExpr c.cl_path cf.cf_name el p with
| None -> (fun() -> type_expr ~mode ctx (EConst (Ident "null"),p) WithType.value)
| Some (EMeta((Meta.MergeBlock,_,_),(EBlock el,_)),_) -> (fun () -> let e = (!type_block_ref) ctx el with_type p in mk (TMeta((Meta.MergeBlock,[],p), e)) e.etype e.epos)
@@ -560,7 +560,6 @@ let load_macro' ctx display cpath f p =
| _ -> error "Macro should be called on a class" p
in
api.MacroApi.current_macro_module <- (fun() -> mloaded);
- DeprecationCheck.check_cf mctx.com meth p;
let meth = (match follow meth.cf_type with TFun (args,ret) -> (args,ret,cl,meth),mloaded | _ -> error "Macro call should be a method" p) in
restore();
if not ctx.in_macro then flush_macro_context mint ctx;
@@ -0,0 +1,12 @@
+class Test {
+ @:deprecated
+ public static macro function test() {
+ return macro {};
+ }
+}
+
+class Main {
+ public static function main() {
+ Test.test();
@@ -0,0 +1 @@
+--run Main
+Main.hx:10: characters 3-14 : Warning : Usage of this field is deprecated