handle arbitrary expressions dependent on static input params in proc signatures
This commit is contained in:
parent
da5d88f04e
commit
f0953db3ba
10 changed files with 60 additions and 18 deletions
|
|
@ -1255,15 +1255,18 @@ proc getSize(typ: PType): BiggestInt =
|
|||
if result < 0: internalError("getSize: " & $typ.kind)
|
||||
|
||||
proc containsGenericTypeIter(t: PType, closure: PObject): bool =
|
||||
if t.kind in GenericTypes + tyTypeClasses + {tyFromExpr}:
|
||||
return true
|
||||
if t.kind == tyStatic:
|
||||
return t.n == nil
|
||||
|
||||
if t.kind == tyTypeDesc:
|
||||
if t.base.kind == tyNone: return true
|
||||
if containsGenericTypeIter(t.base, closure): return true
|
||||
return false
|
||||
|
||||
return t.kind == tyStatic and t.n == nil
|
||||
|
||||
if t.kind in GenericTypes + tyTypeClasses + {tyFromExpr}:
|
||||
return true
|
||||
|
||||
return false
|
||||
|
||||
proc containsGenericType*(t: PType): bool =
|
||||
result = iterOverType(t, containsGenericTypeIter, nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue