diff options
-rw-r--r-- | compiler/liftdestructors.nim | 2 | ||||
-rw-r--r-- | compiler/semtypinst.nim | 14 |
2 files changed, 1 insertions, 15 deletions
diff --git a/compiler/liftdestructors.nim b/compiler/liftdestructors.nim index 0f7273656..cf9743ea4 100644 --- a/compiler/liftdestructors.nim +++ b/compiler/liftdestructors.nim @@ -142,7 +142,7 @@ proc instantiateGeneric(c: var TLiftCtx; op: PSym; t, typeInst: PType): PSym = proc considerAsgnOrSink(c: var TLiftCtx; t: PType; body, x, y: PNode; field: var PSym): bool = - if optNimV2 in c.g.config.globalOptions: + if c.g.config.selectedGC == gcDestructors: let op = field if field != nil and sfOverriden in field.flags: if sfError in op.flags: diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index ccabce155..518921d12 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -617,20 +617,6 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = eraseVoidParams(result) skipIntLiteralParams(result) - of tySequence: - if cl.isReturnType and cl.c.config.selectedGC == gcDestructors and - result.attachedOps[attachedDestructor].isNil and - result[0].kind != tyEmpty and optNimV2 notin cl.c.config.globalOptions: - let s = cl.c.graph.sysTypes[tySequence] - var old = copyType(s, s.owner, keepId=false) - # Remove the 'T' parameter from tySequence: - old.sons.setLen 0 - old.n = nil - old.flags = {tfHasAsgn} - old.addSonSkipIntLit result[0] - result.attachedOps = old.attachedOps - cl.c.typesWithOps.add((result, old)) - else: discard else: # If this type doesn't refer to a generic type we may still want to run it |