revert to old behaviour: tuple field names are not ignored anymore; fixes #1920
This commit is contained in:
parent
a2b7e6c392
commit
abb738146a
9 changed files with 40 additions and 17 deletions
|
|
@ -781,6 +781,15 @@ proc sameTuple(a, b: PType, c: var TSameTypeClosure): bool =
|
|||
|
||||
result = sameTypeAux(x, y, c)
|
||||
if not result: return
|
||||
if a.n != nil and b.n != nil and IgnoreTupleFields notin c.flags:
|
||||
for i in countup(0, sonsLen(a.n) - 1):
|
||||
# check field names:
|
||||
if a.n.sons[i].kind == nkSym and b.n.sons[i].kind == nkSym:
|
||||
var x = a.n.sons[i].sym
|
||||
var y = b.n.sons[i].sym
|
||||
result = x.name.id == y.name.id
|
||||
if not result: break
|
||||
else: internalError(a.n.info, "sameTuple")
|
||||
|
||||
template ifFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} =
|
||||
if tfFromGeneric notin a.flags + b.flags:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue