No longer segfault when using a typeclass with a self referencing type (#19467)
This commit is contained in:
parent
22ae0bef63
commit
1830a3b505
2 changed files with 14 additions and 1 deletions
|
|
@ -1688,7 +1688,8 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
|
|||
var aa = a
|
||||
while aa.kind in {tyTypeDesc, tyGenericParam} and aa.len > 0:
|
||||
aa = lastSon(aa)
|
||||
if aa.kind == tyGenericParam:
|
||||
if aa.kind in {tyGenericParam} + tyTypeClasses:
|
||||
# If the constraint is a genericParam or typeClass this isGeneric
|
||||
return isGeneric
|
||||
result = typeRel(c, f.base, aa, flags)
|
||||
if result > isGeneric: result = isGeneric
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue