Description
The attached propertyaccess.zip contains the following:
src/main/groovy/Widget.groovy
package demo class Widget { static Integer someNumber = 42 }
src/test/groovy/WidgetSpec.groovy
package demo class WidgetSpec extends spock.lang.Specification { void 'test property access'() { given: Widget.metaClass.getSomeNumber = { 2112 } when: def widget = new Widget() then: widget.someNumber == 2112 } }
That test fails because widget.someNumber is 42. If I edit build.gradle and use Groovy 2.3.9 instead of 2.3.10, the test passes. Is this change in behavior intentional?
Lari thinks that maybe https://github.com/groovy/groovy-core/commit/5e446eca2bae406619d8a6b115af6e4521bed2e4 is relevant.
Attachments
Attachments
Issue Links
- relates to
-
GROOVY-7269 Problem With MetaMethods and replacing MetaProperty
- Closed