[
https://issues.apache.org/jira/browse/GROOVY-12617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18135669#comment-18135669
]
ASF GitHub Bot commented on GROOVY-12617:
-----------------------------------------
codecov-commenter commented on PR #3143:
URL: https://github.com/apache/groovy/pull/3143#issuecomment-6540370789
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3143?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 `85.00000%` with `3 lines` in your changes missing
coverage. Please review.
:white_check_mark: Project coverage is 74.0969%. Comparing base
([`ef76fcb`](https://app.codecov.io/gh/apache/groovy/commit/ef76fcba756be3331227627f78b5ba6b62109645?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`b27de77`](https://app.codecov.io/gh/apache/groovy/commit/b27de77ee4adf8488ea9cf104fe80db7dea49f9a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3143?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Patch % | Lines |
|---|---|---|
|
[...sc/StaticTypesMethodReferenceExpressionWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3143?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesMethodReferenceExpressionWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc01ldGhvZFJlZmVyZW5jZUV4cHJlc3Npb25Xcml0ZXIuamF2YQ==)
| 85.0000% | [0 Missing and 3 partials :warning:
](https://app.codecov.io/gh/apache/groovy/pull/3143?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>
[](https://app.codecov.io/gh/apache/groovy/pull/3143?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3143 +/- ##
==================================================
- Coverage 74.1012% 74.0969% -0.0043%
- Complexity 43600 43607 +7
==================================================
Files 1692 1692
Lines 149254 149264 +10
Branches 28286 28293 +7
==================================================
+ Hits 110599 110600 +1
- Misses 28475 28478 +3
- Partials 10180 10186 +6
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3143?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...sc/StaticTypesMethodReferenceExpressionWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3143?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesMethodReferenceExpressionWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc01ldGhvZFJlZmVyZW5jZUV4cHJlc3Npb25Xcml0ZXIuamF2YQ==)
| `88.8889% <85.0000%> (-0.4293%)` | :arrow_down: |
... and [9 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3143/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: a method reference to a functional interface with a primitive return type
> fails at bootstrap when the return value needs a Groovy conversion (e.g.
> String to boolean)
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12617
> URL: https://issues.apache.org/jira/browse/GROOVY-12617
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 4.0.33, 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> import java.util.function.Predicate
> @groovy.transform.CompileStatic
> class C {
> static String str(String s) { s }
> static void main(args) {
> Predicate<String> p = C::str
> assert !p.test('') && p.test('x')
> }
> }
> {code}
> Actual: the code compiles, but evaluating the method reference throws
> {{java.lang.BootstrapMethodError}}, caused by
> {{java.lang.invoke.LambdaConversionException: Type mismatch for lambda
> expected return: class java.lang.String is not convertible to boolean}}. The
> same happens for every primitive return that the type checker accepts but the
> JVM cannot convert: boolean from any reference type or from int,
> ToDoubleFunction from a BigDecimal method, and ToIntFunction from a long or
> Long method.
> Expected: the value is converted as in dynamic Groovy, @TypeChecked code and
> a method pointer ({{C.&str}}), which all give [false, true] here (Groovy
> truth).
> Cause: the static compiler binds the method directly through
> LambdaMetafactory, which converts a return value to a primitive type only by
> unboxing and widening primitive conversion.
> Seen in 4.0.33, 5.0.8 and 6.0.0.
> PR: https://github.com/apache/groovy/pull/3143
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)