Perform nil checks during object construction and within compiles()
Close https://github.com/nim-lang/Nim/issues/6494
This commit is contained in:
parent
7b7e42be54
commit
4f3d309fb0
4 changed files with 10 additions and 7 deletions
|
|
@ -2082,7 +2082,10 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
|||
var err: string
|
||||
try:
|
||||
result = semExpr(c, n, flags)
|
||||
if c.config.errorCounter != oldErrorCount: result = nil
|
||||
if result != nil:
|
||||
trackStmt(c, c.module, result, isTopLevel = false)
|
||||
if c.config.errorCounter != oldErrorCount:
|
||||
result = nil
|
||||
except ERecoverableError:
|
||||
discard
|
||||
# undo symbol table changes (as far as it's possible):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue