added types.isFinal helper proc

This commit is contained in:
Andreas Rumpf
2019-03-14 07:24:07 +01:00
parent ee7a9a272d
commit 1f61498238

View File

@@ -339,6 +339,10 @@ proc canFormAcycleAux(marker: var IntSet, typ: PType, startId: int): bool =
of tyProc: result = typ.callConv == ccClosure
else: discard
proc isFinal*(t: PType): bool =
var t = t.skipTypes(abstractInst)
result = t.kind != tyObject or tfFinal in t.flags
proc canFormAcycle*(typ: PType): bool =
var marker = initIntSet()
result = canFormAcycleAux(marker, typ, typ.id)