summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-09-16 13:54:29 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-09-16 13:54:58 +0200
commit2a59f499e9f5a8aa8ad03891afd38f7641f52a49 (patch)
treeb705cbe4812bc6306157d33682cb7f0f17112ca5 /compiler
parent6c487a6309fd674f3084205c1b4b4353c7847f51 (diff)
downloadNim-2a59f499e9f5a8aa8ad03891afd38f7641f52a49.tar.gz
some gc:destructors progress
Diffstat (limited to 'compiler')
-rw-r--r--compiler/liftdestructors.nim2
-rw-r--r--compiler/semtypinst.nim14
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