preparations for language extensions: 'sink' and 'lent' types

This commit is contained in:
Andreas Rumpf 2018-01-07 23:09:26 +01:00
commit e4081a7201
34 changed files with 183 additions and 178 deletions

View file

@ -102,7 +102,7 @@ proc isDeepConstExpr*(n: PNode): bool =
if not isDeepConstExpr(n.sons[i]): return false
if n.typ.isNil: result = true
else:
let t = n.typ.skipTypes({tyGenericInst, tyDistinct, tyAlias})
let t = n.typ.skipTypes({tyGenericInst, tyDistinct, tyAlias, tySink})
if t.kind in {tyRef, tyPtr}: return false
if t.kind != tyObject or not isCaseObj(t.n):
result = true