concepts: fixes the stack overflow that happens for #6691
This commit is contained in:
parent
4e4d466d06
commit
9e4e1949e8
2 changed files with 15 additions and 1 deletions
|
|
@ -1057,9 +1057,10 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
|
|||
else: isNone
|
||||
|
||||
of tyUserTypeClass, tyUserTypeClassInst:
|
||||
if c.c.matchedConcept != nil:
|
||||
if c.c.matchedConcept != nil and c.c.matchedConcept.depth <= 4:
|
||||
# consider this: 'var g: Node' *within* a concept where 'Node'
|
||||
# is a concept too (tgraph)
|
||||
inc c.c.matchedConcept.depth
|
||||
let x = typeRel(c, a, f, flags + {trDontBind})
|
||||
if x >= isGeneric:
|
||||
return isGeneric
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue