summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-06-17 20:25:25 -0700
committerGitHub <noreply@github.com>2020-06-17 20:25:25 -0700
commit7df27b5035ad128812fbd070e3fa80ef6819e4df (patch)
tree06dbebdba85f971b5a87b4da1272cb2ec7831706 /compiler
parente7f280bd26a54b4f187b087c8d35f43f0e6328c7 (diff)
downloadNim-7df27b5035ad128812fbd070e3fa80ef6819e4df.tar.gz
[cleanups] doassert => doAssert; mark deadcode (#14711)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semtypinst.nim22
1 files changed, 12 insertions, 10 deletions
diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim
index 15a63e75e..22f0d1db6 100644
--- a/compiler/semtypinst.nim
+++ b/compiler/semtypinst.nim
@@ -110,7 +110,7 @@ proc lookup(typeMap: LayeredIdTable, key: PType): PType =
 template put(typeMap: LayeredIdTable, key, value: PType) =
   idTablePut(typeMap.topLayer, key, value)
 
-template checkMetaInvariants(cl: TReplTypeVars, t: PType) =
+template checkMetaInvariants(cl: TReplTypeVars, t: PType) = # noop code
   when false:
     if t != nil and tfHasMeta in t.flags and
        cl.allowMetaTypes == false:
@@ -412,7 +412,7 @@ proc handleGenericInvocation(cl: var TReplTypeVars, t: PType): PType =
       newbody.attachedOps[attachedDeepCopy] = cl.c.instTypeBoundOp(cl.c, dc, result, cl.info,
                                                                    attachedDeepCopy, 1)
     if newbody.typeInst == nil:
-      #doassert newbody.typeInst == nil
+      # doAssert newbody.typeInst == nil
       newbody.typeInst = result
       if tfRefsAnonObj in newbody.flags and newbody.kind != tyGenericInst:
         # can come here for tyGenericInst too, see tests/metatype/ttypeor.nim
@@ -670,14 +670,16 @@ proc replaceTypesInBody*(p: PContext, pt: TIdTable, n: PNode;
   result = replaceTypeVarsN(cl, n)
   popInfoContext(p.config)
 
-proc replaceTypesForLambda*(p: PContext, pt: TIdTable, n: PNode;
-                            original, new: PSym): PNode =
-  var typeMap = initLayeredTypeMap(pt)
-  var cl = initTypeVars(p, typeMap, n.info, original)
-  idTablePut(cl.symMap, original, new)
-  pushInfoContext(p.config, n.info)
-  result = replaceTypeVarsN(cl, n)
-  popInfoContext(p.config)
+when false:
+  # deadcode
+  proc replaceTypesForLambda*(p: PContext, pt: TIdTable, n: PNode;
+                              original, new: PSym): PNode =
+    var typeMap = initLayeredTypeMap(pt)
+    var cl = initTypeVars(p, typeMap, n.info, original)
+    idTablePut(cl.symMap, original, new)
+    pushInfoContext(p.config, n.info)
+    result = replaceTypeVarsN(cl, n)
+    popInfoContext(p.config)
 
 proc recomputeFieldPositions*(t: PType; obj: PNode; currPosition: var int) =
   if t != nil and t.len > 0 and t[0] != nil: