diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/guards.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/guards.nim b/compiler/guards.nim index f02a53684..c43e918d9 100644 --- a/compiler/guards.nim +++ b/compiler/guards.nim @@ -187,7 +187,8 @@ proc usefulFact(n: PNode): PNode = # if a: # ... # We make can easily replace 'a' by '2 < x' here: - result = usefulFact(n.sym.ast) + if n.sym.ast != nil: + result = usefulFact(n.sym.ast) elif n.kind == nkStmtListExpr: result = usefulFact(n.lastSon) |