[ 
https://issues.apache.org/jira/browse/GROOVY-11641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17947667#comment-17947667
 ] 

ASF GitHub Bot commented on GROOVY-11641:
-----------------------------------------

eric-milles opened a new pull request, #2206:
URL: https://github.com/apache/groovy/pull/2206

   It is possible this could be solved in the trait transformation or receiver 
transformer.  At the time of xform, the fields of super trait have already been 
moved to field helper, so it would be some work to locate and decode them.




> trait extends trait and uses static field in static method
> ----------------------------------------------------------
>
>                 Key: GROOVY-11641
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11641
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>
> Consider the following:
> {code:groovy}
>             trait Foo {
>                 public static final String BANG = '!'
>             }
>             trait Bar extends Foo {
>                 static staticMethod(String string) {
>                     string + BANG
>                 }
>             }
>             class Main implements Bar {
>                 static test1() {
>                     String result = staticMethod('works')
>                     assert result == 'works!'
>                 }
>                 void test2() {
>                     String result = staticMethod('works')
>                     assert result == 'works!'
>                 }
>             }
>             Main.test1()
>             new Main().test2()
> {code}



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

Reply via email to