[
https://issues.apache.org/jira/browse/GROOVY-12649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18138743#comment-18138743
]
ASF GitHub Bot commented on GROOVY-12649:
-----------------------------------------
codecov-commenter commented on PR #3222:
URL: https://github.com/apache/groovy/pull/3222#issuecomment-6658145664
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3222?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
Report
:x: Patch coverage is `50.00000%` with `1 line` in your changes missing
coverage. Please review.
:white_check_mark: Project coverage is 74.1736%. Comparing base
([`38b012e`](https://app.codecov.io/gh/apache/groovy/commit/38b012ed693b6d791a7efde760056e4086b8b0fc?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`14333b6`](https://app.codecov.io/gh/apache/groovy/commit/14333b63f805e223add2b3b47903e27755104da7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 4 commits behind head on master.
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3222?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Patch % | Lines |
|---|---|---|
|
[...taticTypesBinaryExpressionMultiTypeDispatcher.java](https://app.codecov.io/gh/apache/groovy/pull/3222?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesBinaryExpressionMultiTypeDispatcher.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc0JpbmFyeUV4cHJlc3Npb25NdWx0aVR5cGVEaXNwYXRjaGVyLmphdmE=)
| 0.0000% | [0 Missing and 1 partial :warning:
](https://app.codecov.io/gh/apache/groovy/pull/3222?src=pr&el=tree&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/3222?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3222 +/- ##
==================================================
+ Coverage 74.1656% 74.1736% +0.0081%
- Complexity 43752 43760 +8
==================================================
Files 1692 1692
Lines 149591 149599 +8
Branches 28382 28386 +4
==================================================
+ Hits 110945 110963 +18
+ Misses 28435 28429 -6
+ Partials 10211 10207 -4
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3222?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3222?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FStaticTypeCheckingVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU3RhdGljVHlwZUNoZWNraW5nVmlzaXRvci5qYXZh)
| `87.8638% <100.0000%> (+0.0052%)` | :arrow_up: |
|
[...taticTypesBinaryExpressionMultiTypeDispatcher.java](https://app.codecov.io/gh/apache/groovy/pull/3222?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesBinaryExpressionMultiTypeDispatcher.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc0JpbmFyeUV4cHJlc3Npb25NdWx0aVR5cGVEaXNwYXRjaGVyLmphdmE=)
| `87.9518% <0.0000%> (ø)` | |
... and [12 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3222/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: explicit spread over a Set or other non-List Iterable that declares the
> property casts each element to the receiver type
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12649
> URL: https://issues.apache.org/jira/browse/GROOVY-12649
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 4.0.33, 5.1.3, 6.0.0
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
>
> Description:
> Under {{@CompileStatic}}, an explicit spread {{coll*.prop}} over a {{Set}}
> subclass, or over any other non-List {{Iterable}}, fails at runtime if the
> receiver's own class declares {{prop}} (as a field or a getter). The compiled
> code reads the receiver's property from each element instead, casting the
> element to the receiver type:
> {code:groovy}
> class Person { String name; Person(String n) { name = n } }
> class PeopleSet extends LinkedHashSet<Person> { String name = 'the set' }
> @groovy.transform.CompileStatic
> def test() {
> def s = new PeopleSet()
> s << new Person('Alice') << new Person('Bob')
> assert s.name == 'the set' // ok
> assert s*.name == ['Alice', 'Bob'] // GroovyCastException: Cannot cast
> object 'Person@...' with class 'Person' to class 'PeopleSet'
> }
> test()
> {code}
> Dynamic Groovy and {{@TypeChecked}} return {{[Alice, Bob]}}: an explicit
> spread always reads the elements.
> ||Receiver ({{x*.name}})||dynamic||CS ≤ 4.0.5||CS 4.0.24 → master||
> |{{Set}} subclass declaring field {{name}}|[Alice, Bob]|[Alice,
> Bob]|GroovyCastException|
> |{{Set}} subclass declaring {{getName()}}|[Alice, Bob]|[Alice,
> Bob]|GroovyCastException|
> |{{Iterable}} (not a Collection) declaring field {{name}}|[Alice,
> Bob]|[Alice, Bob]|GroovyCastException|
> |plain {{Set<Person>}}|[Alice, Bob]|[Alice, Bob]|[Alice, Bob]|
> Seen on JDK 17 with 4.0.24, 4.0.33, 5.0.8, 5.1.3, 6.0.0 and master. It works
> on 3.0.25 and 4.0.5, so this is a regression within the 4.0.x line. I haven't
> bisected it; 9e2ed767e3 (GROOVY-5568, GROOVY-10815, "SC: groovy method as
> property", first in 4.0.7) changed how SC compiles property access and is a
> likely candidate.
> The {{List}} form of this ({{people*.name}} where a List subclass declares
> {{name}}, or gets it from an extension method) is addressed by GROOVY-12534
> (PR #3058). Its spread skip in {{StaticTypeCheckingVisitor.existsProperty}}
> is limited to receivers implementing {{List}}, so the cases above still fail
> with that change applied. Widening that check to any receiver of an explicit
> spread may be enough, but I haven't tested it.
> Related: GROOVY-6311 (resolved), where CS rejected spread over a {{Set}} at
> compile time.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)