summary refs log tree commit diff stats
path: root/tests/pragmas/tinvalidcustompragma.nim
blob: a31695809436c273ce232c6475695ea9af2cf3d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
discard """
  cmd: "nim check $file"
"""

# issue #21652
type Foo = object
template foo() {.tags:[Foo].} = #[tt.Error
                     ^ invalid pragma: tags: [Foo]]#
  discard

{.foobar.} #[tt.Error
  ^ invalid pragma: foobar]#
type A = enum a {.foobar.} #[tt.Error
                  ^ invalid pragma: foobar]#
for b {.foobar.} in [1]: discard #[tt.Error
        ^ invalid pragma: foobar]#
template foobar {.pragma.}
{.foobar.} #[tt.Error
  ^ cannot attach a custom pragma to 'tinvalidcustompragma'; custom pragmas are not supported for modules]#
type A = enum a {.foobar.} #[tt.Error
                  ^ cannot attach a custom pragma to 'a'; custom pragmas are not supported for enum fields]#
for b {.foobar.} in [1]: discard #[tt.Error
        ^ cannot attach a custom pragma to 'b'; custom pragmas are not supported for `for` loop variables]#