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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3177?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 `85.71429%` with `2 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 74.1502%. Comparing base 
([`0941dba`](https://app.codecov.io/gh/apache/groovy/commit/0941dbacf496a1667c27681c6fe76deee59bfb57?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`47a701b`](https://app.codecov.io/gh/apache/groovy/commit/47a701bd9970d1184f6c30da8846dffa052ddda7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 11 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3177?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...rg/codehaus/groovy/classgen/asm/ClosureWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3177?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FClosureWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9DbG9zdXJlV3JpdGVyLmphdmE=)
 | 85.7143% | [0 Missing and 2 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3177?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/3177/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/3177?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3177        +/-   ##
   ==================================================
   - Coverage     74.1533%   74.1502%   -0.0031%     
   - Complexity      43751      43757         +6     
   ==================================================
     Files            1692       1692                
     Lines          149516     149529        +13     
     Branches        28366      28371         +5     
   ==================================================
   + Hits           110871     110876         +5     
   - Misses          28448      28452         +4     
   - Partials        10197      10201         +4     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3177?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...rg/codehaus/groovy/classgen/asm/ClosureWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3177?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FClosureWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9DbG9zdXJlV3JpdGVyLmphdmE=)
 | `90.0794% <85.7143%> (-0.0956%)` | :arrow_down: |
   
   ... and [12 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3177/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>




> Closure packing packs a closure literal composed with >> or << whose 
> composition escapes
> ----------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12656
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12656
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 7.0.0-alpha-1, 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> class Holder { Closure handler }
> @groovy.transform.PackedClosures
> class C {
>     void install(Holder h, Closure c) { h.handler = c >> { x -> x + 1 } }
>     Closure make(Closure c) { return { x -> x + 1 } << c }
> }
> def h = new Holder()
> new C().install(h, { x -> x * 2 })
> h.handler.delegate = 'd'
> def r = new C().make({ x -> x * 2 })
> r.delegate = 'd'
> {code}
> *Actual:* both delegate assignments throw 
> {{java.lang.UnsupportedOperationException: Cannot set a delegate on a 
> @PackedClosures closure (hoisted method '$packed$closure$0') ...}}. The same 
> happens with {{-Dgroovy.target.closure.pack=true}} and under {{@TypeChecked}} 
> and {{@CompileStatic}}.
> *Expected:* the closure literal is declined from packing, as it is when 
> stored or returned directly, and setting a delegate works as it does without 
> packing.
> Cause: the compile-time escape walk in 
> {{ClosureWriter.collectEscapingClosures}} marks only a literal that is itself 
> the stored, appended or returned value. Composition builds a ComposedClosure 
> that keeps a clone of the literal (the clone of a packed closure is still 
> packed) and passes setDelegate on to it, so the literal escapes along with 
> the composition.
> Verified on 6.0.0 and master.



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

Reply via email to