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:
@@ -16,3 +16,7 @@ closures now
|
||||
1337
|
||||
13371010
|
||||
80
|
||||
40
|
||||
41
|
||||
41
|
||||
42
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user