blob: f153880d5d1148c5f1d91aca32a3449cb792b9ff [file] [log] [blame]
package groovy.bugs
import org.codehaus.groovy.classgen.TestSupport
/**
* @version $Revision$
*/
class ClosureWithStaticVariablesBug extends TestSupport {
static y = [:]
void testBug() {
c = { x |
return {
foo = Cheese.z
println foo
assert foo.size() == 0
println y
assert y.size() == 0
return 6
}
}
c2 = c(5)
answer = c2()
assert answer == 6
}
}
class Cheese {
static z = [:]
}