tinvalidtypesym.nim 220 B

123456789101112131415
  1. discard """
  2. errormsg: "type expected, but symbol 'MyType' has no type."
  3. """
  4. import macros
  5. macro foobar(name) =
  6. let sym = genSym(nskType, "MyType")
  7. result = quote do:
  8. type
  9. `name` = `sym`
  10. foobar(MyAlias)