[
https://issues.apache.org/jira/browse/GROOVY-12598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18140670#comment-18140670
]
ASF GitHub Bot commented on GROOVY-12598:
-----------------------------------------
testlens-app[bot] commented on PR #3125:
URL: https://github.com/apache/groovy/pull/3125#issuecomment-6720210156
## 🚨 Jobs failed without executing tests 🚨
### Failed Jobs without Test Failures
❌ [Check licenses / test
\(ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/42470271313/job/128699169502?pr=3125)
❌ [Generate SNAPSHOT artifacts /
dist](https://github.com/apache/groovy/actions/runs/42470271230/job/128699168586?pr=3125)
❌ [Generate SNAPSHOT distributions /
dist](https://github.com/apache/groovy/actions/runs/42470271424/job/128699169644?pr=3125)
❌ [Lint gate /
lint](https://github.com/apache/groovy/actions/runs/42470271359/job/128699169896?pr=3125)
❌ [Performance check /
test](https://github.com/apache/groovy/actions/runs/42470271349/job/128699169341?pr=3125)
❌ [jmh / test \(core-ag,
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42470271324/job/128699169097?pr=3125)
❌ [jmh / test \(grails-ad,
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42470271324/job/128699169285?pr=3125)
❌ [jmh / test \(grails-ez,
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42470271324/job/128699169253?pr=3125)
❌ [jmh-classic / test \(bench,
\\\\.bench\\\\.\)](https://github.com/apache/groovy/actions/runs/42470271411/job/128699169785?pr=3125)
❌ [jmh-classic / test \(core-ag,
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42470271411/job/128699169652?pr=3125)
❌ [jmh-classic / test \(grails-ad,
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42470271411/job/128699169861?pr=3125)
❌ [jmh-classic / test \(grails-ez,
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42470271411/job/128699170011?pr=3125)
🏷️ Commit: b2e0bad390c9db9331517d254d1426867b427a6d
▶️ Tests: 0 executed
🟡 Checks: 14/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/)._
> A trait property referenced from a closure ignores the closure's delegate and
> resolve strategy
> ----------------------------------------------------------------------------------------------
>
> Key: GROOVY-12598
> URL: https://issues.apache.org/jira/browse/GROOVY-12598
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 4.0.33, 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> trait T {
> def cnt = 1
> def m() { [cnt: 42].with { cnt } }
> }
> class C implements T {}
> assert new C().m() == 42
> {code}
> Actual: 1. The closure reads the trait's own property, in dynamic,
> @TypeChecked and @CompileStatic code. Assigning, as in a with closure that
> does cnt = 5, writes the trait property instead of the map. An accessor-only
> property (a getCnt method) behaves the same way, and assigning to it throws
> ReadOnlyPropertyException. A method parameter annotated with DelegatesTo and
> DELEGATE_FIRST behaves the same as with.
> Expected: 42, as for the same code in a class. The delegate is checked first
> under DELEGATE_FIRST, and the property of the implementing instance is used
> only when the delegate does not have one.
> Cause: TraitReceiverTransformer rewrites a reference to a trait field or
> property into a direct access on the implementing instance or a field-helper
> call, even inside a closure. The closure's resolve strategy is therefore
> never consulted.
> Seen in 4.0.33, 5.0.8 and 6.0.0.
> PR: https://github.com/apache/groovy/pull/3125
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)