[
https://issues.apache.org/jira/browse/GROOVY-10815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-10815.
------------------------------
> SC: Access is forbidden for property-style access to getProperties() default
> Groovy method
> ------------------------------------------------------------------------------------------
>
> Key: GROOVY-10815
> URL: https://issues.apache.org/jira/browse/GROOVY-10815
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 4.0.6
> Reporter: Damir Murat
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.7
>
>
> With Groovy 4.0.6, the following code does not compile:
> {code:java}
> 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
> {code}
> 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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)