[
https://issues.apache.org/jira/browse/GROOVY-12560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18134453#comment-18134453
]
ASF GitHub Bot commented on GROOVY-12560:
-----------------------------------------
codecov-commenter commented on PR #3088:
URL: https://github.com/apache/groovy/pull/3088#issuecomment-6507972055
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3088?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.6810%. Comparing base
([`5b077f9`](https://app.codecov.io/gh/apache/groovy/commit/5b077f9dcf610898e3415f1f1cebbaab8eecab61?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`e3760ac`](https://app.codecov.io/gh/apache/groovy/commit/e3760ac631bdee5c7d0bc6e7ed26a2df0be04f4f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 4 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/3088?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3088 +/- ##
==================================================
+ Coverage 73.6711% 73.6810% +0.0099%
- Complexity 42584 42594 +10
==================================================
Files 1678 1678
Lines 146907 146909 +2
Branches 27790 27789 -1
==================================================
+ Hits 108228 108244 +16
+ Misses 28528 28522 -6
+ Partials 10151 10143 -8
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3088?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...m/sc/transformers/BinaryExpressionTransformer.java](https://app.codecov.io/gh/apache/groovy/pull/3088?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.4882% <100.0000%> (+2.3007%)` | :arrow_up: |
... and [10 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3088/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: <=> with operands of different types narrows the right operand, unboxes a
> null left operand or crashes the compiler
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12560
> URL: https://issues.apache.org/jira/browse/GROOVY-12560
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 4.0.33, 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> Under {{@CompileStatic}}, {{a <=> b}} calls the compare method of the wrapper
> of the left operand's type whenever the right operand has a primitive type,
> not only when both operands have the same primitive type:
> {code:groovy}
> @groovy.transform.CompileStatic
> class C {
> static int wide(int x, long y) { x <=> y }
> static int frac(int x, double y) { x <=> y }
> static int nul(Integer x, int y) { x <=> y }
> }
> assert C.wide(0, 4294967296L) == -1 // 0
> assert C.frac(1, 1.5d) == -1 // 0
> assert C.nul(null, 1) == -1 // NullPointerException
> {code}
> When the left operand's type has no such compare method, such as
> {{BigDecimal}}, a type parameter or {{Number}}, the compiler crashes:
> {code:groovy}
> @groovy.transform.CompileStatic
> int cmp(BigDecimal x, int y) { x <=> y }
> // General error during canonicalization: Index 0 out of bounds for length 0
> {code}
> This also hits {{a <=> b >= 0}}, which parses as {{a <=> (b >= 0)}}. Dynamic
> Groovy and {{@TypeChecked}} give -1 in all three cases.
> Expected: only operands of the same primitive type use the wrapper's compare
> method; any other pair is compared as in dynamic Groovy.
> PR: https://github.com/apache/groovy/pull/3088
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)