Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.0-JSR-1
-
None
-
None
-
Debian Linux, JDK 5.0
Description
The following test case fails.
void testUseScopeBug() {
int c = 0
list = [1,2]
use(GroovyClosureMethods.class) {
list.each
}
assert c == list.size()
println "${list.size()} == ${c}"
}
The workaround is to place the 'int c = 0' inside the use() directive, however the above should be allowed as this follows common scoping rules.
Attachments
Issue Links
- is depended upon by
-
GROOVY-754 scoping
- Closed