Macro.hx 317 B

123456789101112131415
  1. import haxe.macro.Context;
  2. import haxe.macro.Expr;
  3. class Macro {
  4. static public macro function foo() {
  5. var pos = Context.currentPos();
  6. return macro @:pos(pos) new Foo();
  7. }
  8. #if macro
  9. static function buildFoo() {
  10. Context.warning('check pos', Context.currentPos());
  11. return Context.typeof(macro [1]);
  12. }
  13. #end
  14. }