[
https://issues.apache.org/jira/browse/GROOVY-12618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18143350#comment-18143350
]
ASF GitHub Bot commented on GROOVY-12618:
-----------------------------------------
testlens-app[bot] commented on PR #3144:
URL: https://github.com/apache/groovy/pull/3144#issuecomment-6813378460
## 🚨 All tests passed but jobs failed 🚨
### Failed Jobs without Test Failures
❌ [Lint gate /
lint](https://github.com/apache/groovy/actions/runs/43146989184/job/130947000681?pr=3144)
🏷️ Commit: c686cefac46efa2eac1ce112f75fb69fc07d5d04
▶️ Tests: 2873 executed
🟡 Checks: 4/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/)._
> A public static super trait method called from a closure in trait code
> ignores the closure's delegate
> -----------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12618
> URL: https://issues.apache.org/jira/browse/GROOVY-12618
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> trait T { static int size() { 1 } }
> trait U extends T {
> def m() { [5, 6].with { size() } }
> static sm() { [5, 6].with { size() } }
> }
> class C implements U {}
> assert new C().m() == 2
> assert C.sm() == 2
> {code}
> Actual: both calls return 1, in dynamic, @TypeChecked and @CompileStatic code.
> Expected: 2, as with the same code written with classes. Inside a with
> closure, the list delegate's size() comes before the owner's.
> The trait transformation rewrites an implicit-this call to a public static
> method inherited from a super trait into a direct call on the trait helper
> class, so the closure's delegate is never consulted. GROOVY-12611 changes
> this for private and static methods declared by the trait itself, but not for
> methods inherited from a super trait.
> Seen in 5.0.8 and 6.0.0.
> PR: https://github.com/apache/groovy/pull/3144
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)