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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3286?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 `80.32787%` with `12 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 74.4424%. Comparing base 
([`856b28a`](https://app.codecov.io/gh/apache/groovy/commit/856b28a961ca5964568c77034b98b6adde2e8f99?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`f2d8410`](https://app.codecov.io/gh/apache/groovy/commit/f2d84108ebfcd7b72511a3a86e0e2ba5cb046bf9?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/3286?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/StaticTypeCheckingSupport.java](https://app.codecov.io/gh/apache/groovy/pull/3286?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FStaticTypeCheckingSupport.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU3RhdGljVHlwZUNoZWNraW5nU3VwcG9ydC5qYXZh)
 | 80.4878% | [0 Missing and 8 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3286?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3286?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)
 | 80.0000% | [0 Missing and 4 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3286?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/3286/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/3286?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3286        +/-   ##
   ==================================================
   - Coverage     74.4429%   74.4424%   -0.0005%     
   - Complexity      44774      44824        +50     
   ==================================================
     Files            1702       1702                
     Lines          151891     151947        +56     
     Branches        29091      29113        +22     
   ==================================================
   + Hits           113072     113113        +41     
   + Misses          28413      28412         -1     
   - Partials        10406      10422        +16     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3286?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/3286?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.9513% <80.0000%> (-0.0191%)` | :arrow_down: |
   | 
[...roovy/transform/stc/StaticTypeCheckingSupport.java](https://app.codecov.io/gh/apache/groovy/pull/3286?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FStaticTypeCheckingSupport.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU3RhdGljVHlwZUNoZWNraW5nU3VwcG9ydC5qYXZh)
 | `79.2812% <80.4878%> (+0.0058%)` | :arrow_up: |
   
   ... and [10 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3286/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: e.getClass() is typed Class<?>, so since GROOVY-12714 it is rejected 
> where a Class<? extends T> is expected
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12755
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12755
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 7.0.0-alpha-1, 6.0.1
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> JLS 4.3.2 gives a call {{e.getClass()}} the type {{Class<? extends |T|>}}, 
> where {{|T|}} is the erasure of the static type of {{e}}. Static type 
> checking types it with the declared return type of {{Object#getClass()}}, 
> {{Class<?>}}. Until GROOVY-12714 the wildcard check accepted {{Class<?>}} 
> where a {{Class<? extends T>}} was expected. Since GROOVY-12714 (GROOVY_6_0_X 
> and master) it is rejected:
> {code:groovy}
> @groovy.transform.CompileStatic
> class C {
>     interface Store {}
>     static <T> T with(Class<? extends Store> type, Closure<T> body) { 
> body.call() }
>     static class Adapter { Adapter(Class<? extends Store> type) {} }
>     static Object viaMethod(Store store) { with(store.getClass()) { 1 } }
>     static Object viaProperty(Store store) { with(store.class) { 1 } }
>     static Object viaConstructor(Store store) { new Adapter(store.getClass()) 
> }
>     static Class<? extends Store> viaReturn(Store store) { store.getClass() }
> }
> {code}
> {noformat}
> [Static type checking] - Cannot call <T> C#with(java.lang.Class<? extends 
> C.Store>, groovy.lang.Closure<T>) with arguments [java.lang.Class<?>, 
> groovy.lang.Closure]
> [Static type checking] - Cannot call <T> C#with(java.lang.Class<? extends 
> C.Store>, groovy.lang.Closure<T>) with arguments [java.lang.Class<?>, 
> groovy.lang.Closure]
> [Static type checking] - Cannot call C$Adapter#<init>(java.lang.Class<? 
> extends C.Store>) with arguments [java.lang.Class<?>]
> [Static type checking] - Incompatible generic argument types. Cannot assign 
> java.lang.Class<?> to: java.lang.Class<? extends C.Store>
> {noformat}
> javac accepts the equivalent Java. Grails no longer compiles against 
> GROOVY_6_0_X: it passes {{datastore.getClass()}} to a {{Class<? extends 
> Datastore>}} parameter and {{registrar.getClass()}} to a {{Class<? extends 
> BeanRegistrar>}} one 
> (https://github.com/apache/grails-core/actions/runs/42702095261).
> Typing {{e.getClass()}} and {{e.class}} as {{Class<? extends |T|>}} makes 
> more calls pass an upper-bounded wildcard for a bounded type parameter, such 
> as {{foo(list.class)}} for {{<T extends List<Integer>> foo(Class<T>)}}, which 
> GROOVY-12754 rejected. So this depends on GROOVY-12754.
> The inferred type of {{list.class}} for a raw {{List list}} changes from 
> {{Class<? extends Object>}} to {{Class<? extends List>}}, and the GROOVY-5415 
> error for {{a.bar(this.getClass())}} now names {{Class<? extends ClassB>}}; 
> the two tests that assert those types are updated.
> PR: https://github.com/apache/groovy/pull/3286



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

Reply via email to