tuple field names are ignored

This commit is contained in:
Araq 2014-12-23 17:54:22 +01:00
commit c0cc62c6b1
9 changed files with 29 additions and 40 deletions

View file

@ -349,7 +349,7 @@ proc recordRel(c: var TCandidate, f, a: PType): TTypeRelation =
var y = a.n.sons[i].sym
if f.kind == tyObject and typeRel(c, x.typ, y.typ) < isSubtype:
return isNone
if x.name.id != y.name.id: return isNone
if x.name.id != y.name.id and f.kind != tyTuple: return isNone
proc allowsNil(f: PType): TTypeRelation {.inline.} =
result = if tfNotNil notin f.flags: isSubtype else: isNone