[
https://issues.apache.org/jira/browse/GROOVY-12624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18135715#comment-18135715
]
ASF GitHub Bot commented on GROOVY-12624:
-----------------------------------------
codecov-commenter commented on PR #3150:
URL: https://github.com/apache/groovy/pull/3150#issuecomment-6540907107
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3150?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 74.0980%. Comparing base
([`ef76fcb`](https://app.codecov.io/gh/apache/groovy/commit/ef76fcba756be3331227627f78b5ba6b62109645?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`e7d0085`](https://app.codecov.io/gh/apache/groovy/commit/e7d0085b4f4fcc049167a34da91f12fd518fb940?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/3150?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3150 +/- ##
==================================================
- Coverage 74.1012% 74.0980% -0.0032%
+ Complexity 43600 43598 -2
==================================================
Files 1692 1692
Lines 149254 149255 +1
Branches 28286 28287 +1
==================================================
- Hits 110599 110595 -4
- Misses 28475 28477 +2
- Partials 10180 10183 +3
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3150?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...oovy/transform/trait/TraitReceiverTransformer.java](https://app.codecov.io/gh/apache/groovy/pull/3150?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Ftrait%2FTraitReceiverTransformer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS90cmFpdC9UcmFpdFJlY2VpdmVyVHJhbnNmb3JtZXIuamF2YQ==)
| `88.8889% <100.0000%> (+0.0564%)` | :arrow_up: |
... and [8 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3150/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests,
report on failures, and find test suite problems.
- :package: [JS Bundle
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save
yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
> SC resolves calls that the trait transformation adds in a closure against the
> closure's delegate
> ------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12624
> URL: https://issues.apache.org/jira/browse/GROOVY-12624
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> @groovy.transform.CompileStatic
> trait V {
> static String who() { this.simpleName }
> def m() { new Object().with { who() } }
> }
> class E implements V {}
> assert new E().m() == 'E'
> class Dg {
> String who(Class c) { 'delegate' }
> }
> @groovy.transform.CompileStatic
> trait T {
> static String who() { this.simpleName }
> def m() { new Dg().with { who() } }
> }
> class C implements T {}
> assert new C().m() == 'C'
> {code}
> Actual: under static compilation the first m() returns 'Object' (the
> delegate's class), also when who is declared in a super trait or called as
> this.who(). The second m() returns 'delegate': it calls Dg.who(Class) with
> the self argument that the trait transformation added.
> Expected: 'E' and 'C', as dynamic Groovy and @TypeChecked return.
> Cause: TraitReceiverTransformer rewrites the call to a trait helper call with
> the receiver class as first argument. Both the outer helper call and the
> inner getClass() call keep the default implicit-this flag, so the static
> compiler resolves them against the closure's delegate.
> Seen on master; 5.0.8 and 6.0.0 reported the same.
> PR: https://github.com/apache/groovy/pull/3150
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)