From a88a965c6d3f54086f2682dc98ee9e5930c2fa66 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 18 Dec 2016 00:06:46 +0100 Subject: [PATCH] fixes nimsuggest issue #40 --- compiler/semfold.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 42fa60781..36918b2e1 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -768,7 +768,7 @@ proc getConstExpr(m: PSym, n: PNode): PNode = of nkCast: var a = getConstExpr(m, n.sons[1]) if a == nil: return - if n.typ.kind in NilableTypes: + if n.typ != nil and n.typ.kind in NilableTypes: # we allow compile-time 'cast' for pointer types: result = a result.typ = n.typ