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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3007?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 72.4391%. Comparing base 
([`6194927`](https://app.codecov.io/gh/apache/groovy/commit/61949271fc13446e8cf385d3e3e5968c6c72f92b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`3b64433`](https://app.codecov.io/gh/apache/groovy/commit/3b64433ea376f981a873ed6e9a8e1c1001397511?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 2 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/3007/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/3007?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3007        +/-   ##
   ==================================================
   + Coverage     72.4286%   72.4391%   +0.0105%     
   - Complexity      40654      40687        +33     
   ==================================================
     Files            1643       1644         +1     
     Lines          142811     142898        +87     
     Branches        26852      26877        +25     
   ==================================================
   + Hits           103436     103514        +78     
   + Misses          29827      29825         -2     
   - Partials         9548       9559        +11     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3007?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[.../codehaus/groovy/runtime/DefaultGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/3007?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FDefaultGroovyMethods.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvRGVmYXVsdEdyb292eU1ldGhvZHMuamF2YQ==)
 | `75.7121% <100.0000%> (+0.0062%)` | :arrow_up: |
   
   ... and [16 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3007/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: Method abs misbehaves under static compilation
> --------------------------------------------------
>
>                 Key: GROOVY-12471
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12471
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.5.23, 3.0.25, 5.0.3, 4.0.33, 5.1.3, 6.0.0
>            Reporter: Björn Kautler
>            Assignee: Paul King
>            Priority: Major
>
> The snippet
> {code:groovy}
> @groovy.transform.CompileStatic
> def delta(Number item, Number value) {
>   (item - value).abs()
> }
> println delta(2.2, 3.3)
> println delta(Long.MAX_VALUE, 1)
> {code}
> produces the outputs "1" and "2" while it should be "1.1" and 
> "9223372036854775806".
> I assume the problem is, that SC chooses {{DGM.abs(Number)}} which unluckily 
> assumes that {{{}Long{}}}, {{{}Float{}}}, {{{}Double{}}}, {{{}BigInteger{}}}, 
> and {{BigDecimal}} are handled by other methods (DGM or in the type itself) 
> and thus treats any input as integer or smaller and returning {{{}int{}}}, 
> while this assumption does not necessarily hold under static compilation.



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

Reply via email to