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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3176?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 `0%` with `1 line` in your changes missing coverage. 
Please review.
   :white_check_mark: Project coverage is 74.1472%. 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 
([`3ed8752`](https://app.codecov.io/gh/apache/groovy/commit/3ed8752efd4516e8cf2112591bce24390995e762?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/3176?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/3176?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=)
 | 0.0000% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3176?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/3176/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/3176?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3176        +/-   ##
   ==================================================
   - Coverage     74.1533%   74.1472%   -0.0060%     
   + Complexity      43751      43746         -5     
   ==================================================
     Files            1692       1692                
     Lines          149516     149516                
     Branches        28366      28366                
   ==================================================
   - Hits           110871     110862         -9     
   - Misses          28448      28451         +3     
   - Partials        10197      10203         +6     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3176?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[src/main/java/groovy/transform/PackedClosures.java](https://app.codecov.io/gh/apache/groovy/pull/3176?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Ftransform%2FPackedClosures.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvdHJhbnNmb3JtL1BhY2tlZENsb3N1cmVzLmphdmE=)
 | `100.0000% <ø> (ø)` | |
   | 
[...rg/codehaus/groovy/classgen/asm/ClosureWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3176?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.3096% <0.0000%> (+0.1346%)` | :arrow_up: |
   
   ... and [14 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3176/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 stored to a script binding variable or 
> dynamic property, which then rejects a delegate
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12655
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12655
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 7.0.0-alpha-1, 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> @groovy.transform.PackedClosures
> def install() { handler = { x -> x + 1 } }
> install()
> handler.delegate = 'd'
> handler(1)
> {code}
> *Actual:* {{java.lang.UnsupportedOperationException: Cannot set a delegate on 
> a @PackedClosures closure (hoisted method '$packed$closure$0') ...}}
> *Expected:* the closure is not packed, because it escapes into the script 
> binding, and the script returns 2 as it does without the annotation.
> The same happens when a method of an annotated class stores to an undeclared 
> name (a dynamic property, e.g. one taken by {{propertyMissing}}) and when a 
> script method stores to an {{@Field}}. With 
> {{-Dgroovy.target.closure.pack=true}}, a binding store in a script's run 
> method is packed too, and so is one in {{@CompileStatic}} code whose type 
> checking extension makes the variable dynamic.
> Cause: the escape gate in {{ClosureWriter}} ({{isLocalTarget}}) treats any 
> assignment target that is not a field or property node as a local, including 
> a {{DynamicVariable}}, which is stored through the MOP where code outside the 
> method can read it.
> Verified on 6.0.0 and master.



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

Reply via email to