From 7df27b5035ad128812fbd070e3fa80ef6819e4df Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 17 Jun 2020 20:25:25 -0700 Subject: [cleanups] doassert => doAssert; mark deadcode (#14711) --- compiler/semtypinst.nim | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'compiler/semtypinst.nim') 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: -- cgit 1.4.1-2-gfad0