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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3107?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 73.7648%. Comparing base 
([`396e862`](https://app.codecov.io/gh/apache/groovy/commit/396e862eda6c8a2fddaeb3eaf58e86cb5e6f08bc?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`0d2a49a`](https://app.codecov.io/gh/apache/groovy/commit/0d2a49a7d5efdd2e902d3a11d6a2d27a7ca0f708?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>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/3107/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/3107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3107        +/-   ##
   ==================================================
   - Coverage     73.7763%   73.7648%   -0.0115%     
   + Complexity      42753      42746         -7     
   ==================================================
     Files            1678       1678                
     Lines          147462     147462                
     Branches        27899      27900         +1     
   ==================================================
   - Hits           108792     108775        -17     
   - Misses          28513      28522         +9     
   - Partials        10157      10165         +8     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3107?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...groovy/classgen/asm/sc/StaticInvocationWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3107?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticInvocationWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNJbnZvY2F0aW9uV3JpdGVyLmphdmE=)
 | `75.2759% <100.0000%> (ø)` | |
   
   ... and [10 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3107/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 delegating closure in an instance initializer block fails for a 
> delegate that is not a Groovy object
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12581
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12581
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 5.0.8, 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> @groovy.transform.CompileStatic
> class C {
>     List<String> log = [];
>     { log << new StringBuilder('a').with { append('b'); toString() } }
> }
> new C() // IncompatibleClassChangeError: Class java.lang.StringBuilder does 
> not implement the requested interface groovy.lang.GroovyObject
> {code}
> The type checker records when an implicit-this call in a closure goes to the 
> delegate, and the static invocation writer then replaces the receiver with 
> {{this.delegate}}, but keeps the call adapter chosen for a call on {{this}}. 
> The instance initializer blocks of a {{@CompileStatic}} class are type 
> checked but their calls get no method targets, so the call is made 
> dynamically with {{ScriptBytecodeAdapter.invokeMethodOnCurrent}}, which takes 
> a {{GroovyObject}}. {{with}}, {{tap}} and other delegating closures in such 
> blocks fail with any delegate that is not a Groovy object. 4.0.33 returns 
> {{[ab]}}.
> PR: https://github.com/apache/groovy/pull/3107



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

Reply via email to