Macro.macro.hx 244 B

1234567891011121314
  1. import haxe.macro.Context;
  2. function build() {
  3. switch (Context.getLocalClass().get().name) {
  4. case "Foo":
  5. switch Context.getType("Bar") {
  6. case TInst(cls,_): cls.get();
  7. case _:
  8. }
  9. case "Bar":
  10. throw "Ohno";
  11. }
  12. return null;
  13. }