[ 
https://issues.apache.org/jira/browse/GROOVY-11758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles resolved GROOVY-11758.
----------------------------------
    Fix Version/s: 5.0.2
       Resolution: Fixed

> IllegalAccessError: trait property and protected/package-private super access 
> method
> ------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11758
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11758
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.2
>
>
> Consider the following:
> {code:groovy}
> trait A {
>   final long id = 123L
> }
> class B {
>   protected final long getId() { 456L }
> }
> class C extends B implements A {
> }
> def c = new C()
> assert c.id == '456L'
> assert c.getId() == '456L'
> {code}
> The property expression "c.id" throws an IllegalAccessError at run time.
> https://github.com/apache/groovy/blob/39ced53e046cf2f5cad4ac8babc3ee4995642b07/src/test/groovy/org/codehaus/groovy/transform/traitx/TraitASTTransformationTest.groovy#L443



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to