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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3156?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 `93.54839%` with `4 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 74.1208%. Comparing base 
([`a4f2035`](https://app.codecov.io/gh/apache/groovy/commit/a4f2035e15da9f1bbfedeec011e9393144007372?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`39dd302`](https://app.codecov.io/gh/apache/groovy/commit/39dd302bed14fbafaa41e7cee39cdbb2beb9fa8e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3156?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...us/groovy/classgen/asm/BinaryExpressionHelper.java](https://app.codecov.io/gh/apache/groovy/pull/3156?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FBinaryExpressionHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9CaW5hcnlFeHByZXNzaW9uSGVscGVyLmphdmE=)
 | 94.1176% | [0 Missing and 2 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3156?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...a/org/apache/groovy/ast/tools/ExpressionUtils.java](https://app.codecov.io/gh/apache/groovy/pull/3156?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fast%2Ftools%2FExpressionUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dyb292eS9hc3QvdG9vbHMvRXhwcmVzc2lvblV0aWxzLmphdmE=)
 | 75.0000% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3156?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...m/sc/transformers/BinaryExpressionTransformer.java](https://app.codecov.io/gh/apache/groovy/pull/3156?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fsc%2Ftransformers%2FBinaryExpressionTransformer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zYy90cmFuc2Zvcm1lcnMvQmluYXJ5RXhwcmVzc2lvblRyYW5zZm9ybWVyLmphdmE=)
 | 95.8333% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3156?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/3156/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/3156?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3156        +/-   ##
   ==================================================
   + Coverage     74.1036%   74.1208%   +0.0173%     
   - Complexity      43604      43650        +46     
   ==================================================
     Files            1692       1692                
     Lines          149264     149321        +57     
     Branches        28289      28307        +18     
   ==================================================
   + Hits           110610     110678        +68     
   + Misses          28474      28450        -24     
   - Partials        10180      10193        +13     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3156?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...a/org/apache/groovy/ast/tools/ExpressionUtils.java](https://app.codecov.io/gh/apache/groovy/pull/3156?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fast%2Ftools%2FExpressionUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dyb292eS9hc3QvdG9vbHMvRXhwcmVzc2lvblV0aWxzLmphdmE=)
 | `79.4118% <75.0000%> (-0.1063%)` | :arrow_down: |
   | 
[...m/sc/transformers/BinaryExpressionTransformer.java](https://app.codecov.io/gh/apache/groovy/pull/3156?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fsc%2Ftransformers%2FBinaryExpressionTransformer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zYy90cmFuc2Zvcm1lcnMvQmluYXJ5RXhwcmVzc2lvblRyYW5zZm9ybWVyLmphdmE=)
 | `94.4444% <95.8333%> (+0.0942%)` | :arrow_up: |
   | 
[...us/groovy/classgen/asm/BinaryExpressionHelper.java](https://app.codecov.io/gh/apache/groovy/pull/3156?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FBinaryExpressionHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9CaW5hcnlFeHByZXNzaW9uSGVscGVyLmphdmE=)
 | `89.5541% <94.1176%> (+0.2684%)` | :arrow_up: |
   
   ... and [14 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3156/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>




> Compound assignment and increment on a property evaluate the receiver 
> expression twice
> --------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12619
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12619
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 4.0.33, 5.0.8, 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> class Box { int v = 1 }
> class C {
>     int calls = 0
>     Box box = new Box()
>     Box obj() { calls++; box }
>     def m() { obj().v += 2; [calls, box.v] }
>     def n() { obj().v++; [calls, box.v] }
> }
> assert new C().m() == [1, 3]
> assert new C().n() == [1, 2]
> {code}
> Actual: m() returns [2, 3] and n() returns [2, 2]. The receiver obj() is 
> called once for the read of the property and again for the write. The same 
> happens in dynamic Groovy, under @TypeChecked and under @CompileStatic. It 
> also happens for prefix and postfix increment and decrement, attribute access 
> ({{obj().@f += 2}}), safe navigation ({{obj()?.v += 2}}), chains with a 
> side-effecting getter, static properties reached through an instance, and 
> extension properties such as File text. Under @CompileStatic, {{obj().d++}} 
> on a BigDecimal property calls obj() three times.
> Expected: the receiver is evaluated once, before the right-hand side, and 
> reused for the read and the write. Subscripts already behave this way 
> (GROOVY-12098).
> Cause: the code generator evaluated the property expression once as an rvalue 
> and once as the assignment target. The static compiler's rewrites to x.p = 
> x.p.op\(y) and to the extension setter reused the receiver expression on both 
> sides. The elvis assignment form is GROOVY-12515.
> Seen in 4.0.33, 5.0.8 and 6.0.0.
> PR: https://github.com/apache/groovy/pull/3145



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

Reply via email to