bugfix: cycle analysis needs to take inheritance into account
This commit is contained in:
parent
fcd91a0cd6
commit
776920dc71
1 changed files with 5 additions and 3 deletions
|
|
@ -330,8 +330,10 @@ proc canFormAcycleAux(marker: var TIntSet, typ: PType, startId: int): bool =
|
|||
if t.n != nil: result = canFormAcycleNode(marker, t.n, startId)
|
||||
else:
|
||||
result = t.id == startId
|
||||
else:
|
||||
nil
|
||||
if t.kind == tyObject and tfFinal notin t.flags:
|
||||
# damn inheritance may introduce cycles:
|
||||
result = true
|
||||
else: nil
|
||||
|
||||
proc canFormAcycle(typ: PType): bool =
|
||||
# XXX as I expect cycles introduced by closures are very rare, we pretend
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue