tyTypeDesc and tyRange always have 1 child; this might be tyNone but it is required for skipTypes

This commit is contained in:
Araq 2014-02-05 23:43:13 +01:00
commit d912d18379
11 changed files with 87 additions and 42 deletions

View file

@ -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