[
https://issues.apache.org/jira/browse/GROOVY-12756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18149747#comment-18149747
]
ASF GitHub Bot commented on GROOVY-12756:
-----------------------------------------
codecov-commenter commented on PR #3349:
URL: https://github.com/apache/groovy/pull/3349#issuecomment-7098387125
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3349?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 `81.25000%` with `6 lines` in your changes missing
coverage. Please review.
:white_check_mark: Project coverage is 74.9614%. 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
([`5db27e3`](https://app.codecov.io/gh/apache/groovy/commit/5db27e318e29fad029aa6c49bd003ce46dd418bd?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/3349?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/3349?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 5 partials :warning:
](https://app.codecov.io/gh/apache/groovy/pull/3349?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
|
|
[...ovy/classgen/asm/sc/StaticTypesLambdaAnalyzer.java](https://app.codecov.io/gh/apache/groovy/pull/3349?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesLambdaAnalyzer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc0xhbWJkYUFuYWx5emVyLmphdmE=)
| 66.6667% | [0 Missing and 1 partial :warning:
](https://app.codecov.io/gh/apache/groovy/pull/3349?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/3349?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3349 +/- ##
==================================================
+ Coverage 74.9518% 74.9614% +0.0096%
- Complexity 48908 48958 +50
==================================================
Files 1768 1768
Lines 161213 161283 +70
Branches 31728 31756 +28
==================================================
+ Hits 120832 120900 +68
+ Misses 28968 28966 -2
- Partials 11413 11417 +4
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3349?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/StaticInvocationWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3349?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticInvocationWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNJbnZvY2F0aW9uV3JpdGVyLmphdmE=)
| `78.3557% <100.0000%> (+0.1095%)` | :arrow_up: |
|
[...ovy/classgen/asm/sc/StaticTypesLambdaAnalyzer.java](https://app.codecov.io/gh/apache/groovy/pull/3349?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesLambdaAnalyzer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc0xhbWJkYUFuYWx5emVyLmphdmE=)
| `93.4524% <66.6667%> (+0.0392%)` | :arrow_up: |
|
[...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3349?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.9340% <80.0000%> (+0.0169%)` | :arrow_up: |
... and [17 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3349/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: since GROOVY-12714 a value that is not a Class cannot be assigned to a
> parameterized Class variable
> --------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12756
> URL: https://issues.apache.org/jira/browse/GROOVY-12756
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 7.0.0-alpha-1, 6.0.1
> Reporter: Scott Murphy Heiberg
> Assignee: Paul King
> Priority: Major
> Fix For: 7.0.0-alpha-1, 6.0.1
>
>
> Anything can be assigned to a variable of type {{Class}}, {{String}} or
> {{Boolean}}: the value is converted at run time, so {{Class c =
> 'java.lang.String'}} loads the class. That still compiles for a raw
> {{Class}}. Since GROOVY-12714 (GROOVY_6_0_X and master) static type checking
> rejects it when the variable's type has a type argument, even {{Class<?>}}:
> {code:groovy}
> import java.lang.reflect.ParameterizedType
> import java.lang.reflect.Type
> @groovy.transform.CompileStatic
> abstract class Editor<T> {
> final Class<T> targetType
> Editor() {
> Type[] types = ((ParameterizedType)
> getClass().genericSuperclass).actualTypeArguments
> targetType = types[0]
> }
> }
> @groovy.transform.CompileStatic
> void test(Type type, Object object) {
> Class raw = type // compiles
> Class<?> any = type // error
> Class<String> string = 'java.lang.String' // error
> Class<? extends Number> number = object // error
> }
> {code}
> {noformat}
> [Static type checking] - Incompatible generic argument types. Cannot assign
> java.lang.reflect.Type to: java.lang.Class<T>
> [Static type checking] - Incompatible generic argument types. Cannot assign
> java.lang.reflect.Type to: java.lang.Class<?>
> [Static type checking] - Incompatible generic argument types. Cannot assign
> java.lang.String to: java.lang.Class<java.lang.String>
> [Static type checking] - Incompatible generic argument types. Cannot assign
> java.lang.Object to: java.lang.Class<? extends java.lang.Number>
> {noformat}
> All of these compiled on GROOVY_6_0_X before GROOVY-12714 (a5d10dd198). The
> first is {{AbstractStructuredBindingEditor}} in Grails, which no longer
> compiles against GROOVY_6_0_X.
> For an assignment to a {{Class}}, {{String}} or {{Boolean}} variable,
> {{getResultType}} returned the variable's type. GROOVY-12714 made it keep the
> type of the value when the variable is a parameterized {{Class}}, so that
> {{Class<?>}} is no longer accepted for {{Class<? extends CharSequence>}}.
> That is right when the value is a {{Class}}. When it is not, there are no
> type arguments to compare, and {{checkTypeGenerics}} reports the value's type
> as an incompatible generic argument.
> The value's type should be kept only when it is a {{Class}}.
> Pull request: https://github.com/apache/groovy/pull/3289
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)