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

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

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

   ## 🚨 All tests passed but jobs failed 🚨
   
   ### Failed Jobs without Test Failures
   
   ❌ [Build and test / lts \(17, 
macos-latest\)](https://github.com/apache/groovy/actions/runs/41169529984/job/124444270558?pr=3115)
   ❌ [Build and test / lts \(17, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41169529984/job/124444270563?pr=3115)
   ❌ [Build and test / lts \(17, windows-latest, 
1\)](https://github.com/apache/groovy/actions/runs/41169529984/job/124444270642?pr=3115)
   ❌ [Build and test / lts \(21, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41169529984/job/124444270608?pr=3115)
   ❌ [Build and test / lts \(25, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41169529984/job/124444270400?pr=3115)
   
   🏷️ Commit: 940ed1951ccca36e3c5a8906f4e149eaf6b5e8c8
   ▶️ Tests:  45189 executed
   ⚪️ Checks: 26/26 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/)._
   




> SC calls a trait's static accessor read as a property on the trait instead of 
> the implementing class
> ----------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12590
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12590
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> @groovy.transform.CompileStatic
> trait T {
>     static boolean flag = true
>     static boolean isReady() { flag }
>     static String sm() { ready ? 'yes' : 'no' }
>     static Closure getG() { { -> flag } }
>     static Object sg() { g.call() }
> }
> class C implements T {}
> assert C.sm() == 'yes'
> assert C.sg() == true
> {code}
> Actual: groovy.lang.MissingMethodException: No signature of static method: 
> T__flag$get for class: T is applicable for argument types: () values: []
> Expected: both assertions pass, as they do with @TypeChecked or without an 
> annotation, and as they do when the accessor is called directly 
> ({{isReady()}}, {{getG()}}).
> The same happens in instance trait methods, in closures and lambdas, and when 
> a static accessor is written with property syntax ({{cnt = 1}}, {{cnt += 1}}, 
> {{cnt++}} for a static {{setCnt(int)}}), including for an accessor of a super 
> trait. Under static compilation the property resolves to the static method 
> that the trait interface declares, which forwards to the trait helper with 
> the trait itself as the receiver class, so the accessor cannot reach the 
> implementing class's trait state. The direct method call passes the 
> implementing class to the helper instead.
> Seen in 6.0.0 and master. 5.0.8 rejects the code with "No such property: 
> ready for Class or static property for class: T", and 4.0.33 with "Access to 
> T#ready is forbidden".
> PR: https://github.com/apache/groovy/pull/3115



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

Reply via email to