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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3149?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 `70.00000%` with `12 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 74.1014%. 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 
([`d32e23a`](https://app.codecov.io/gh/apache/groovy/commit/d32e23a8d68f867f068622ef5b5bc562c5c75e90?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/3149?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/3149?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==)
 | 70.0000% | [5 Missing and 7 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3149?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/3149/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/3149?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3149        +/-   ##
   ==================================================
   + Coverage     74.1012%   74.1014%   +0.0002%     
   - Complexity      43600      43621        +21     
   ==================================================
     Files            1692       1692                
     Lines          149254     149290        +36     
     Branches        28286      28302        +16     
   ==================================================
   + Hits           110599     110626        +27     
   - Misses          28475      28481         +6     
   - Partials        10180      10183         +3     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3149?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/3149?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==)
 | `87.6050% <70.0000%> (-1.7131%)` | :arrow_down: |
   
   ... and [12 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3149/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 generic method used for a primitive SAM return 
> type (e.g. Predicate) throws ClassCastException instead of applying Groovy 
> truth
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12623
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12623
>             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 <T> T id(T t) { t }
>     static void main(args) {
>         Predicate<String> p = C::id
>         assert [p.test(''), p.test('x')] == [false, true]
>     }
> }
> {code}
> Actual: {{java.lang.ClassCastException: class java.lang.String cannot be cast 
> to class java.lang.Boolean}} at {{p.test('x')}}. The same happens for the get 
> method of a Map of String to String used as a Predicate (bound or unbound), 
> List::first, an Optional's get as a BooleanSupplier, and generic instance 
> methods. For numeric SAMs, a ToIntFunction of String or Character with 
> {{C::id}} gives "cannot be cast to class java.lang.Number".
> Expected: [false, true], as in dynamic Groovy and under @TypeChecked; 120 and 
> 65 for the numeric cases.
> When the referenced method returns a type parameter, the static compiler sets 
> the instantiated return type to the SAM's wrapper type (GROOVY-10975) and 
> leaves the conversion to LambdaMetafactory, which only casts and unboxes.
> Seen in 4.0.33, 5.0.8 and 6.0.0.
> PR: https://github.com/apache/groovy/pull/3149



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

Reply via email to