better better fix for Issue #629 Recursive generic types not working

This commit is contained in:
Mark Flamer 2013-10-30 16:08:54 -07:00
commit f8206cb357

View file

@ -838,11 +838,10 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
of tyDistinct: of tyDistinct:
CycleCheck() CycleCheck()
if c.cmp == dcEq: if c.cmp == dcEq:
result = false if sameFlags(a, b):
if a.sym != nil and b.sym != nil: IfFastObjectTypeCheckFailed(a, b):
if a.sym.name == b.sym.name: result = sameTypeAux(a.sons[0], b.sons[0], c)
result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b) else:
else:
result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b) result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b)
of tyEnum, tyForward, tyProxy: of tyEnum, tyForward, tyProxy:
# XXX generic enums do not make much sense, but require structural checking # XXX generic enums do not make much sense, but require structural checking