blob: e1b7e1a1c0ba3bd6f218eb6fb53d4f882d1fb7e1 [file] [log] [blame]
/**
* @version $Revision$
*/
class BlockAsClosureBug extends GroovyTestCase {
void testBug() {
c = 0
block: {
c = 9
}
println(c)
assert c == 9
}
void testStaticBug() {
main(null)
}
void testNonVoidMethod() {
foo()
}
static void main(args) {
c = 0
block: {
c = 9
}
println(c)
assert c == 9
}
foo() {
c = 0
block: {
c = 9
}
println(c)
assert c == 9
return 5
}
}