Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.6
-
None
Description
With Groovy 4.0.6, the following code does not compile:
import groovy.transform.CompileStatic @CompileStatic class Person { String firstName String lastName } @CompileStatic class Runner { static void runMe() { Person person = new Person(firstName: "First", lastName: "Last") println person.getProperties() println person.properties // -> Does not compile with an error "Access to Person#properties is forbidden" } } Runner.runMe() Person person = new Person(firstName: "First", lastName: "Last") println person.getProperties() println person.properties
If I comment/delete CompileStatic on the Runner class, the code works as expected.
Similarly, and probably related to the issue, my own extension methods starting with "get" cannot be accessed too.
Tnx.
Attachments
Issue Links
- is related to
-
GROOVY-5568 DGM properties not available in interfaces?
- Closed
-
GROOVY-10075 Static compiler incorrectly typechecks extension modules
- Closed