This commit is contained in:
Araq
2024-06-13 18:11:22 +02:00
parent 9172d26870
commit ab4e52fb86
2 changed files with 2 additions and 13 deletions

View File

@@ -97,17 +97,6 @@ proc hashTree(c: var MD5Context, n: PNode; flags: set[ConsiderFlag]; conf: Confi
else:
for i in 0..<n.len: hashTree(c, n[i], flags, conf)
#import renderer
proc hasEmptyBody(t: PType): bool =
case t.kind
of tyObject:
result = t.n.safeLen == 0
of tyTuple:
result = t.kidsLen == 0
else:
result = false
proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]; conf: ConfigRef) =
if t == nil:
c &= "\254"
@@ -127,7 +116,7 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]; conf: Confi
else:
c.hashSym(t.sym)
of tyGenericInst:
if sfInfixCall in t.base.sym.flags or CoConsiderOwned in flags: # hasEmptyBody(t.base):
if sfInfixCall in t.base.sym.flags or CoConsiderOwned in flags:
# This is an imported C++ generic type.
# We cannot trust the `lastSon` to hold a properly populated and unique
# value for each instantiation, so we hash the generic parameters here:

View File

@@ -2491,7 +2491,7 @@ proc arrayConstr(c: PContext, n: PNode): PType =
result = newTypeS(tyArray, c)
rawAddSon(result, makeRangeType(c, 0, 0, n.info))
addSonSkipIntLit(result, skipTypes(n.typ,
{tyGenericInst, tyVar, tyLent, tyOrdinal}), c.idgen)
{tyVar, tyLent, tyOrdinal}), c.idgen)
proc arrayConstr(c: PContext, info: TLineInfo): PType =
result = newTypeS(tyArray, c)