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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3338?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 `75.75758%` with `16 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 74.9516%. Comparing base 
([`09e84fa`](https://app.codecov.io/gh/apache/groovy/commit/09e84fa4b0d4c37a5ac2efc48dfd2db93a84cab7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`a1076bd`](https://app.codecov.io/gh/apache/groovy/commit/a1076bd62166c7e8eca62beebf19cfa001bd81b2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3338?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3338?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)
 | 74.1379% | [0 Missing and 15 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...groovy/classgen/asm/sc/StaticTypesTypeChooser.java](https://app.codecov.io/gh/apache/groovy/pull/3338?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesTypeChooser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc1R5cGVDaG9vc2VyLmphdmE=)
 | 87.5000% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3338?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/3338/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/3338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3338        +/-   ##
   ==================================================
   - Coverage     74.9518%   74.9516%   -0.0001%     
   - Complexity      48908      48977        +69     
   ==================================================
     Files            1768       1768                
     Lines          161213     161316       +103     
     Branches        31728      31776        +48     
   ==================================================
   + Hits           120832     120909        +77     
   - Misses          28968      28976         +8     
   - Partials        11413      11431        +18     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3338?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...groovy/classgen/asm/sc/StaticTypesTypeChooser.java](https://app.codecov.io/gh/apache/groovy/pull/3338?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesTypeChooser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc1R5cGVDaG9vc2VyLmphdmE=)
 | `96.2963% <87.5000%> (-3.7037%)` | :arrow_down: |
   | 
[...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3338?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)
 | `87.8045% <74.1379%> (-0.1126%)` | :arrow_down: |
   
   ... and [11 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3338/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: a closure written as an operator operand, a branch of a conditional 
> argument or a named constructor argument gets no parameter types from the 
> functional interface
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12824
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12824
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> import java.util.function.Function
> class Bean { Function<String, String> value }
> class Sink { Function<String, String> last; Sink leftShift(Function<String, 
> String> f) { last = f; this } }
> @groovy.transform.CompileStatic
> class C {
>     static String apply(Function<String, String> f) { f.apply('a') }
>     static List<String> test(boolean flag) {
>         def sink = new Sink()
>         sink << { it.toUpperCase() }
>         [apply(flag ? { it.toUpperCase() } : { it.trim() }),
>          new Bean(value: { it.toUpperCase() }).value.apply('a'),
>          sink.last.apply('a')]
>     }
> }
> assert C.test(true) == ['A', 'A', 'A']
> {code}
> With 6.0.0 and master, under @CompileStatic or @TypeChecked, each of the 
> three closures is rejected:
> {noformat}
> [Static type checking] - Cannot find matching method 
> java.lang.Object#toUpperCase(). Please check if the declared type is correct 
> and if the method exists.
> {noformat}
> A closure passed as an argument, or assigned to a variable or property of a 
> functional interface type, gets the types of its parameters from the 
> interface, so its implicit parameter is a String. A closure written in these 
> three places does not:
> * as the operand of an operator method, such as leftShift(Function<String, 
> String>);
> * as a branch of a conditional expression passed as an argument;
> * as a named argument of a constructor call, for a property of the interface 
> type.
> The same holds for a lambda with an untyped parameter.
> In each, the type checker visits the closure before it knows the operator 
> method, the method or the property: the right operand of an operator before 
> its method is looked up, an argument that is not itself a closure before the 
> method is chosen, and the map of named arguments before the properties are 
> checked.



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

Reply via email to