There is one regression caused by the change for GROOVY-11029. I am testing a
fix. The workaround is to remove static compilation or to write "other =
'value'" as "it.other = 'value'" so the "owner.delegate" gets applied properly.
class Bar {
@groovy.beans.Bindable
String baz
String other
}
class Foo {
Bar bar
@groovy.beans.Bindable
String foo
@groovy.transform.CompileStatic
void postConstruct() {
bar = new Bar()
bar.with {
addPropertyChangeListener('baz') { event ->
other = 'value' // ClassCastException: class Foo cannot be cast to
class Bar
print 'changed'
}
}
print 'ready;'
}
}
Foo foo = new Foo()
foo.postConstruct()
foo.getBar().setBaz('xxx')
https://github.com/groovy/groovy-eclipse/issues/1412