mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
When running `check`/`suggest` in a file with an invalid user pragma
like
```nim
{.pragma foo: test.}
```
It will continue to try and process it which leads to the compiler
running into a `FieldDefect`
```
fatal.nim(53) sysFatal
Error: unhandled exception: field 'sons' is not accessible for type 'TNode' using 'kind = nkIdent' [FieldDefect]
```
This makes it instead bail out trying to process the user pragma if its
invalid
10 lines
178 B
Nim
10 lines
178 B
Nim
discard """
|
|
cmd: "nim check $file"
|
|
"""
|
|
|
|
{.pragma test: foo.} #[tt.Error
|
|
^ invalid pragma: {.pragma, test: foo.} ]#
|
|
|
|
{.pragma: 1.} #[tt.Error
|
|
^ invalid pragma: {.pragma: 1.} ]#
|