ARC: ported the GC tests over to --gc:arc

This commit is contained in:
Araq 2019-11-25 15:29:41 +01:00 • committed by Andreas Rumpf
commit 72237e2bcf
14 changed files with 79 additions and 29 deletions

View file

@ -60,6 +60,7 @@ proc lowerTupleUnpacking*(g: ModuleGraph; n: PNode; owner: PSym): PNode =
var temp = newSym(skTemp, getIdent(g.cache, genPrefix), owner, value.info, g.config.options)
temp.typ = skipTypes(value.typ, abstractInst)
incl(temp.flags, sfFromGeneric)
incl(temp.flags, sfCursor)
var v = newNodeI(nkVarSection, value.info)
let tempAsNode = newSymNode(temp)

View file

@ -759,6 +759,7 @@ proc track(tracked: PEffects, n: PNode) =
# check required for 'nim check':
if n[1].typ.len > 0:
createTypeBoundOps(tracked, n[1].typ.lastSon, n.info)
createTypeBoundOps(tracked, n[1].typ, n.info)
for i in 0 ..< safeLen(n):
track(tracked, n.sons[i])
of nkDotExpr:

View file

@ -886,6 +886,10 @@ proc semAnyRef(c: PContext; n: PNode; kind: TTypeKind; prev: PType): PType =
t.flags.incl tfHasOwned
t.rawAddSonNoPropagationOfTypeFlags result
result = t
#if result.kind == tyRef and c.config.selectedGC == gcDestructors:
# result.flags.incl tfHasAsgn
# XXX Something like this is a good idea but it should be done
# in sempass2!
proc findEnforcedStaticType(t: PType): PType =
# This handles types such as `static[T] and Foo`,