[
https://issues.apache.org/jira/browse/GROOVY-12596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18135629#comment-18135629
]
ASF GitHub Bot commented on GROOVY-12596:
-----------------------------------------
testlens-app[bot] commented on PR #3123:
URL: https://github.com/apache/groovy/pull/3123#issuecomment-6539842055
## 🚨 All tests passed but jobs failed 🚨
### Failed Jobs without Test Failures
❌ [Build and test / lts \(17, windows-latest,
1\)](https://github.com/apache/groovy/actions/runs/41170582129/job/124447484510?pr=3123)
🏷️ Commit: 199db60eafea6e7ca1e0c00c0a2052a00f6e12ad
▶️ Tests: 54116 executed
🟡 Checks: 24/25 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/)._
> STC rejects "this.name" for a static accessor of a trait in trait code
> ("static method of interface T can only be accessed with class qualifier")
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12596
> URL: https://issues.apache.org/jira/browse/GROOVY-12596
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 4.0.33, 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> @groovy.transform.TypeChecked // or @CompileStatic
> trait T {
> private static boolean flag = true
> static boolean isReady() { flag }
> boolean check() { this.ready }
> }
> class C implements T {}
> assert new C().check()
> {code}
> Actual:
> {noformat}
> [Static type checking] - static method of interface T can only be accessed
> with class qualifier
> {noformat}
> Expected: the script compiles and {{check()}} returns true, as it does in
> dynamic Groovy and with the method form {{this.isReady()}}.
> The same error is reported for a getX accessor ({{this.name}} for {{static
> String getName()}}), inside a closure or lambda, and for {{this.cnt}} in a
> static method of a sub-trait when the accessor is declared by the super
> trait. Trait code compiles {{this.ready}} to a property read on the trait
> helper's self parameter, which has the trait type. The check for static
> interface members then treats it as an instance-qualified access to a static
> interface method, although in trait code {{this}} stands for the implementing
> class, which has the accessor.
> 6.0.0 reports the same error. 4.0.33 and 5.0.8 reject the code with "No such
> property: ready for class: T".
> PR: https://github.com/apache/groovy/pull/3123
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)