tinvalidcustompragma.nim 851 B

123456789101112131415161718192021222324
  1. discard """
  2. cmd: "nim check $file"
  3. """
  4. # issue #21652
  5. type Foo = object
  6. template foo() {.tags:[Foo].} = #[tt.Error
  7. ^ invalid pragma: tags: [Foo]]#
  8. discard
  9. {.foobar.} #[tt.Error
  10. ^ invalid pragma: foobar]#
  11. type A = enum a {.foobar.} #[tt.Error
  12. ^ invalid pragma: foobar]#
  13. for b {.foobar.} in [1]: discard #[tt.Error
  14. ^ invalid pragma: foobar]#
  15. template foobar {.pragma.}
  16. {.foobar.} #[tt.Error
  17. ^ cannot attach a custom pragma to 'tinvalidcustompragma'; custom pragmas are not supported for modules]#
  18. type A = enum a {.foobar.} #[tt.Error
  19. ^ cannot attach a custom pragma to 'a'; custom pragmas are not supported for enum fields]#
  20. for b {.foobar.} in [1]: discard #[tt.Error
  21. ^ cannot attach a custom pragma to 'b'; custom pragmas are not supported for `for` loop variables]#