tyTypeDesc and tyRange always have 1 child; this might be tyNone but it is required for skipTypes
This commit is contained in:
parent
c097acedd3
commit
d912d18379
11 changed files with 87 additions and 42 deletions
|
|
@ -47,7 +47,7 @@ proc equalParams*(a, b: PNode): TParamsEquality
|
|||
# returns whether the parameter lists of the procs a, b are exactly the same
|
||||
proc isOrdinalType*(t: PType): bool
|
||||
proc enumHasHoles*(t: PType): bool
|
||||
# XXX it is WRONG to include tyTypeDesc here as that might not have any child!
|
||||
|
||||
const
|
||||
abstractPtrs* = {tyVar, tyPtr, tyRef, tyGenericInst, tyDistinct, tyOrdinal,
|
||||
tyConst, tyMutable, tyTypeDesc}
|
||||
|
|
@ -1258,7 +1258,7 @@ proc containsGenericTypeIter(t: PType, closure: PObject): bool =
|
|||
return true
|
||||
|
||||
if t.kind == tyTypeDesc:
|
||||
if t.sonsLen == 0: return true
|
||||
if t.sons[0].kind == tyNone: return true
|
||||
if containsGenericTypeIter(t.base, closure): return true
|
||||
return false
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue