fixes nimsuggest issue #40

This commit is contained in:
Araq
2016-12-18 00:06:46 +01:00
parent bda8a6c1b7
commit a88a965c6d

View File

@@ -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