even more strict isNil handling for strings/seqs in order to detect bugs
This commit is contained in:
parent
9047c3f582
commit
64517445ea
36 changed files with 193 additions and 245 deletions
|
|
@ -759,9 +759,10 @@ proc initSameTypeClosure: TSameTypeClosure =
|
|||
discard
|
||||
|
||||
proc containsOrIncl(c: var TSameTypeClosure, a, b: PType): bool =
|
||||
result = not isNil(c.s) and c.s.contains((a.id, b.id))
|
||||
result = c.s.len > 0 and c.s.contains((a.id, b.id))
|
||||
if not result:
|
||||
if isNil(c.s): c.s = @[]
|
||||
when not defined(nimNoNilSeqs):
|
||||
if isNil(c.s): c.s = @[]
|
||||
c.s.add((a.id, b.id))
|
||||
|
||||
proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue