MacroFail.hx 249 B

123456789101112
  1. class MacroFail {
  2. static function doStuff() {
  3. switch (haxe.macro.Context.getType("B")) {
  4. case TInst(_.get() => cl, _):
  5. for (field in cl.fields.get()) {
  6. trace(field.name, field.expr()?.pos);
  7. }
  8. default:
  9. throw false;
  10. }
  11. }
  12. }