[
https://issues.apache.org/jira/browse/GROOVY-12716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18139974#comment-18139974
]
ASF GitHub Bot commented on GROOVY-12716:
-----------------------------------------
codecov-commenter commented on PR #3250:
URL: https://github.com/apache/groovy/pull/3250#issuecomment-6697559304
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3250?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 74.3417%. Comparing base
([`7a317c9`](https://app.codecov.io/gh/apache/groovy/commit/7a317c9eca012331421066955272e5016d0f4570?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`a95c86b`](https://app.codecov.io/gh/apache/groovy/commit/a95c86b69519901e55cb98df46fde7e93aa35fb0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 3 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/3250?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3250 +/- ##
==================================================
+ Coverage 74.3385% 74.3417% +0.0032%
- Complexity 44310 44317 +7
==================================================
Files 1699 1699
Lines 150860 150875 +15
Branches 28755 28760 +5
==================================================
+ Hits 112147 112163 +16
+ Misses 28439 28436 -3
- Partials 10274 10276 +2
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3250?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3250?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FStaticTypeCheckingVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU3RhdGljVHlwZUNoZWNraW5nVmlzaXRvci5qYXZh)
| `88.0772% <100.0000%> (+0.0368%)` | :arrow_up: |
... and [13 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3250/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>
> STC: an overloaded method pointer assigned to a functional interface is
> checked against overloads its parameter types cannot select
> -----------------------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12716
> URL: https://issues.apache.org/jira/browse/GROOVY-12716
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> import java.util.function.*
> @groovy.transform.CompileStatic
> class C {
> Function<Integer,Integer> f() { Math.&abs }
> BiFunction<Integer,Integer,Integer> g() { Math.&max }
> void h() { Function<Integer,Integer> i = Math.&abs; assert i.apply(-1) ==
> 1 }
> }
> {code}
> *Actual:* {{Possible loss of precision from double to java.lang.Integer}} for
> each method pointer.
> *Expected:* it compiles and runs, as on 6.0.0. An {{Integer}} argument
> selects {{abs(int)}} and {{max(int,int)}} at run time.
> The check for the return value of a method pointer takes the common type of
> all the overloads of the name, here {{double}}, including those that values
> of the functional interface's parameter types never select. Since
> GROOVY-12623 (commit d1710f88eb) a method pointer gets its target type when
> it is assigned or returned, so such a pointer now reaches this check.
> The overloads that count are the best match for the parameter types, and any
> with narrower parameter types, which a value of a subtype selects. So
> {{ToIntFunction<Object> g = C.&f}} with {{int f(Object)}} and {{long
> f(Long)}} is still reported, as {{f(Long)}} may be called.
> Master only: 6.0.0 compiles and runs the example.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)