Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-beta-5
-
Fix Version/s: 1.0-JSR-5
-
Component/s: None
-
Labels:None
Description
output = "a"
[1,1,1].each {
output = output + "b"
[1,1,1].each {
output = output + "c"
}
}
print output
I expected "abcccbcccbccc" but I get "abbb"
Issue Links
- is depended upon by
-
GROOVY-754
scoping
-
-
GROOVY-764
closures
-
- is duplicated by
-
GROOVY-918
Cannot set outside variables from within nested closures
-
I haven't checked, but this looks like one of the variable scoping issues (the class gen code often mistakes the use of a variable for it's declaration). I've started writing a semantic analyzer that will fix this and a variety of other variable scoping issues, but I'm absolutely swamped right now with paying work, so it may be a while. Sorry.