add perentheses around closed variable access (*closed_variables->a), etc, so that nothing can have higher precidence than the dereference (++ was incrementing the pointer instead of the value)

This commit is contained in:
Nathan Braswell
2015-06-26 13:51:57 -04:00
parent 1e76bf2772
commit 727c228ede
3 changed files with 16 additions and 3 deletions

View File

@@ -16,3 +16,7 @@ closures now
1337
13371010
80
40
41
41
42

View File

@@ -34,6 +34,12 @@ fun main():int {
var idx = 0
runLambda(fun():int { return v.get(idx);})
var outside = 40
runLambda(fun():int { var toRet = outside; outside += 1; return toRet;})
println(outside)
runLambda(fun():int { var toRet = outside; outside++; return toRet;})
println(outside)
return 0
}