This commit is contained in:
Andreas Rumpf 2021-03-23 23:46:19 +01:00 • committed by GitHub
commit dbde97f649
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -685,7 +685,8 @@ proc getConstExpr(m: PSym, n: PNode; idgen: IdGenerator; g: ModuleGraph): PNode
of nkDerefExpr, nkHiddenDeref:
let a = getConstExpr(m, n[0], idgen, g)
if a != nil and a.kind == nkNilLit:
localError(g.config, n.info, "nil dereference is not allowed")
result = nil
#localError(g.config, n.info, "nil dereference is not allowed")
of nkCast:
var a = getConstExpr(m, n[1], idgen, g)
if a == nil: return