[cleanups] doassert => doAssert; mark deadcode (#14711)

This commit is contained in:
Timothee Cour 2020-06-17 20:25:25 -07:00 • committed by GitHub
commit 7df27b5035
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 24 deletions

View file

@ -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: