diff options
author | Mark Flamer <mflamer@vectorworks.net> | 2013-10-30 16:08:54 -0700 |
---|---|---|
committer | Mark Flamer <mflamer@vectorworks.net> | 2013-10-30 16:09:00 -0700 |
commit | f8206cb357d71d1aa274dddb8f2976c396c7de4b (patch) | |
tree | 4f6c829bac2f451c45eea386b4f36cad25a5dc13 /compiler | |
parent | 4330c986db6b0a5023a64444bbd64dc0b585b628 (diff) | |
download | Nim-f8206cb357d71d1aa274dddb8f2976c396c7de4b.tar.gz |
better better fix for Issue #629 Recursive generic types not working
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/types.nim | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/types.nim b/compiler/types.nim index 058eb77ed..4dec9ea2f 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -838,11 +838,10 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = of tyDistinct: CycleCheck() if c.cmp == dcEq: - result = false - if a.sym != nil and b.sym != nil: - if a.sym.name == b.sym.name: - result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b) - else: + if sameFlags(a, b): + IfFastObjectTypeCheckFailed(a, b): + result = sameTypeAux(a.sons[0], b.sons[0], c) + else: result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b) of tyEnum, tyForward, tyProxy: # XXX generic enums do not make much sense, but require structural checking |