cleaned up some tests

This commit is contained in:
Araq 2015-02-09 12:42:00 +01:00
commit 247af96b00
25 changed files with 19 additions and 8 deletions

View file

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