forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
custom pragmas: correct error condition, remove outdated symkind whit…
…elist (nim-lang#21653) * test not restricting custom pragma applied symbols fixes nim-lang#21652 * fix other test * different patch * fix tests * actually test nim-lang#18212 and other routines
- Loading branch information
Showing
5 changed files
with
73 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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]# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters