You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/11/09 20:05:00 UTC
[jira] [Resolved] (GROOVY-10815) SC: Access is forbidden for property-style access to getProperties() default Groovy method
[ https://issues.apache.org/jira/browse/GROOVY-10815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-10815.
----------------------------------
Resolution: Fixed
https://github.com/apache/groovy/commit/9210cfab6aac681a865c57dd97e96aac73f38fd4
> 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
>
> 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)