mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 14:23:45 +00:00
* test not restricting custom pragma applied symbols fixes #21652 * fix other test * different patch * fix tests * actually test #18212 and other routines
24 lines
851 B
Nim
24 lines
851 B
Nim
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]#
|