fixes bug reported in PR #5637
This commit is contained in:
parent
560d87f5fd
commit
6cb8bf8045
3 changed files with 20 additions and 1 deletions
|
|
@ -1387,6 +1387,14 @@ proc skipTypes*(t: PType, kinds: TTypeKinds): PType =
|
|||
result = t
|
||||
while result.kind in kinds: result = lastSon(result)
|
||||
|
||||
proc skipTypes*(t: PType, kinds: TTypeKinds; maxIters: int): PType =
|
||||
result = t
|
||||
var i = maxIters
|
||||
while result.kind in kinds:
|
||||
result = lastSon(result)
|
||||
dec i
|
||||
if i == 0: return nil
|
||||
|
||||
proc skipTypesOrNil*(t: PType, kinds: TTypeKinds): PType =
|
||||
## same as skipTypes but handles 'nil'
|
||||
result = t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue