Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
class Foo { private i = 1 @groovy.transform.CompileStatic def m() { new String().with {i}} } assert new Foo().m() == 1 class Bar extends Foo {} assert new Bar().m() == 1
For this code the static compiler is supposed to create a bridge method in Foo and provide access to the private field "i" through that, as well as calling the method directly from within the with-block. Instead the compiler works using dynamic property access, which will cause the property not being found in the second assert because of MOP limitations
Attachments
Issue Links
- is related to
-
GROOVY-7304 Cannot mutate private field from within an AIC or a closure
- Closed