[ 
https://issues.apache.org/jira/browse/GROOVY-12534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18133309#comment-18133309
 ] 

ASF GitHub Bot commented on GROOVY-12534:
-----------------------------------------

codecov-commenter commented on PR #3058:
URL: https://github.com/apache/groovy/pull/3058#issuecomment-6457990150

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3058?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 `33.33333%` with `6 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 73.6086%. Comparing base 
([`cfd9b2f`](https://app.codecov.io/gh/apache/groovy/commit/cfd9b2f0222a8e1a74473f7c5b2cb45b5bdd3b5b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`08f754f`](https://app.codecov.io/gh/apache/groovy/commit/08f754f0b0867a9fda46bff488270c4684e36a85?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 2 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3058?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[.../groovy/transform/sc/StaticCompilationVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3058?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fsc%2FStaticCompilationVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zYy9TdGF0aWNDb21waWxhdGlvblZpc2l0b3IuamF2YQ==)
 | 33.3333% | [3 Missing and 3 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3058?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>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/3058/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/3058?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3058        +/-   ##
   ==================================================
   + Coverage     73.6047%   73.6086%   +0.0038%     
   - Complexity      42348      42351         +3     
   ==================================================
     Files            1657       1657                
     Lines          145708     145714         +6     
     Branches        27498      27501         +3     
   ==================================================
   + Hits           107248     107258        +10     
   + Misses          28479      28474         -5     
   - Partials         9981       9982         +1     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3058?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[.../groovy/transform/sc/StaticCompilationVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3058?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fsc%2FStaticCompilationVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zYy9TdGF0aWNDb21waWxhdGlvblZpc2l0b3IuamF2YQ==)
 | `83.8710% <33.3333%> (-0.4266%)` | :arrow_down: |
   
   ... and [9 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3058/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: a property defined by an extension method of List is read from each 
> element of the list
> -------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12534
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12534
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> Under {{@CompileStatic}}, a property whose getter is an extension method of 
> {{List}}, or of a class that implements {{List}}, is compiled as a property 
> of the list's elements: the getter is called once for each element, with the 
> element cast to the extension's receiver type. With this extension module:
> {code:java}
> package demo;
> import java.util.List;
> public class ListExtension {
>     public static String getJoined(List<String> self) { return 
> String.join(",", self); }
> }
> {code}
> {code:groovy}
> @groovy.transform.CompileStatic
> class C {
>     def test(List<String> words) { words.joined }
> }
> new C().test(['x', 'y']) // GroovyCastException: Cannot cast object 'x' with 
> class 'java.lang.String' to class 'java.util.List'
> {code}
> {{words.getJoined()}} returns 'x,y' in every mode, and dynamic Groovy and 
> {{@TypeChecked}} return 'x,y' for {{words.joined}} too. On an empty list, 
> {{words.joined}} evaluates to {{[]}} instead of an empty string.
> {{StaticCompilationVisitor.existsProperty}} marks the property expression 
> spread-safe when the getter's declaring class implements {{List}} but does 
> not declare the getter, which is meant for a property of the element type. 
> The declaring class of an extension method is its receiver type, which never 
> declares it. Extension getters declared for {{Collection}} or {{Iterable}}, 
> such as {{getIndices}} and {{isSorted}}, are not affected. 
> {{DefaultGroovyMethodsSTCTest.testPropertySemantics2}}, which 
> {{StaticCompileDGMTest}} also runs, keeps the property forms of 
> {{getSequence(List)}} and {{getString(List)}} from {{TestStringExtension}} 
> commented out. Seen in 4.0.33, 5.0.8, 6.0.0 and master.
> Expected: the property calls the extension getter on the list, as in dynamic 
> Groovy and {{@TypeChecked}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to