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

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

testlens-app[bot] commented on PR #3124:
URL: https://github.com/apache/groovy/pull/3124#issuecomment-6539422999

   ## 🚨 All tests passed but jobs failed 🚨
   
   ### Failed Jobs without Test Failures
   
   ❌ [Build and test / lts \(21, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41170716229/job/124447899319?pr=3124)
   
   🏷️ Commit: 70716c1e8eca492d445808cd2e8295d1f87c1334
   ▶️ Tests:  5220 executed
   🟡 Checks: 8/24 completed
   
   ### Rerun Controls
   
   Click the checkbox to trigger a rerun:
   
   🔲 **Rerun jobs**
   
   ---
   _Learn more about TestLens at 
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
   




> Calling a stateful trait static method through the trait fails with 
> MissingMethodException for the internal field accessor
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12597
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12597
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> trait T {
>     private static boolean flag = true
>     static boolean isReady() { flag }
> }
> class C implements T {}
> assert C.isReady()
> assert T.isReady()
> {code}
> Actual: {{T.isReady()}} (and {{T.ready}}) throws 
> {{groovy.lang.MissingMethodException: No signature of static method: 
> T__flag$get for class: T is applicable for argument types: () values: []}}. 
> The same happens in dynamic Groovy, with @TypeChecked and with 
> @CompileStatic, and for static properties, setters, closures and private 
> static helpers.
> Expected: trait static state belongs to each implementing class, so the trait 
> itself has none. The call should fail with an error that says so, not with a 
> missing internal accessor. Stateless static methods called through the trait 
> keep working.
> Cause: the promoted interface static forwarder passes the trait class as the 
> static self of the helper method. A static field access in the helper becomes 
> a call to the generated accessor (here T__flag$get) on that class, and only 
> implementing classes declare one.
> Seen in 6.0.0. 5.x does not promote trait statics onto the interface.
> PR: https://github.com/apache/groovy/pull/3124



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to