fixes endless recursion with static type parameters

This commit is contained in:
Araq 2015-02-14 21:47:21 +01:00
commit 442dc30922
2 changed files with 27 additions and 2 deletions

View file

@ -1016,9 +1016,17 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
if result != isNone: put(c.bindings, f, aOrig)
else:
result = isNone
elif prev.kind == tyStatic:
if aOrig.kind == tyStatic:
result = typeRel(c, prev.lastSon, a)
if result != isNone and prev.n != nil:
if not exprStructuralEquivalent(prev.n, aOrig.n):
result = isNone
else: result = isNone
else:
result = typeRel(c, prev, aOrig)
# XXX endless recursion?
#result = typeRel(c, prev, aOrig)
result = isNone
of tyTypeDesc:
var prev = PType(idTableGet(c.bindings, f))
if prev == nil: