Fix comparison of tyGenericBody in typerel (#8045)

As shown in #7734 and #7733 the logic in typerel fails to determine that
`type Foo` and `type Foo` are indeed equal.

Fixes #7734
This commit is contained in:
LemonBoy 2018-07-07 20:49:06 +02:00 • committed by Andreas Rumpf
commit 88714e77d8
2 changed files with 20 additions and 1 deletions

View file

@ -1425,7 +1425,7 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
of tyGenericBody:
considerPreviousT:
if a.kind == tyGenericInst and a.sons[0] == f:
if a == f or a.kind == tyGenericInst and a.sons[0] == f:
bindingRet isGeneric
let ff = lastSon(f)
if ff != nil: