cleaned up some tests
This commit is contained in:
parent
3a8f7d505b
commit
247af96b00
25 changed files with 19 additions and 8 deletions
|
|
@ -683,12 +683,14 @@ proc track(tracked: PEffects, n: PNode) =
|
|||
for child in n:
|
||||
let last = lastSon(child)
|
||||
if child.kind == nkIdentDefs and last.kind != nkEmpty:
|
||||
# prevent the all too common 'var x = int' bug: XXX
|
||||
track(tracked, last)
|
||||
for i in 0 .. child.len-3:
|
||||
initVar(tracked, child.sons[i], volatileCheck=false)
|
||||
addAsgnFact(tracked.guards, child.sons[i], last)
|
||||
notNilCheck(tracked, last, child.sons[i].typ)
|
||||
#if last.kind != nkEmpty:
|
||||
# prevent the all too common 'var x = int' bug: XXX
|
||||
|
||||
# since 'var (a, b): T = ()' is not even allowed, there is always type
|
||||
# inference for (a, b) and thus no nil checking is necessary.
|
||||
of nkCaseStmt: trackCase(tracked, n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue