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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2742?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 69.8622%. Comparing base 
([`023b9f5`](https://app.codecov.io/gh/apache/groovy/commit/023b9f5e319d1ecf12d89fb7fb5491a0f56e5fd1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`bcd6d90`](https://app.codecov.io/gh/apache/groovy/commit/bcd6d90b8c79963841ca9c19c9491f9b7a5600ec?dropdown=coverage&el=desc&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/2742/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/2742?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2742        +/-   ##
   ==================================================
   - Coverage     69.8687%   69.8622%   -0.0064%     
   - Complexity      35137      35141         +4     
   ==================================================
     Files            1554       1554                
     Lines          130731     130733         +2     
     Branches        23916      23918         +2     
   ==================================================
   - Hits            91340      91333         -7     
   - Misses          31145      31150         +5     
   - Partials         8246       8250         +4     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2742?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...ain/java/org/codehaus/groovy/ast/GenericsType.java](https://app.codecov.io/gh/apache/groovy/pull/2742?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2FGenericsType.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9HZW5lcmljc1R5cGUuamF2YQ==)
 | `87.7193% <100.0000%> (+0.1087%)` | :arrow_up: |
   
   ... and [5 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2742/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>




> False positive "name clash" for a valid override when a `? super` wildcard 
> uses a type that declares the same type variable name
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12203
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12203
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 5.0.7
>            Reporter: Octavia Togami
>            Priority: Major
>
> The following code in a `Repro.groovy` will cause the error:
> {code:groovy}
> interface Box<T> { }
> interface Spec {
>     <T extends Number> void m(Box<? super T> b)
> }
> class Impl implements Spec {
>     @Override
>     <T extends Number> void m(Box<? super T> b) { }
> }
> {code}
> {code:sh}
> $ groovyc Repro.groovy
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> Repro.groovy: 8: name clash: m(Box<? super T>) in class 'Impl' and m(Box<? 
> super T>) in interface 'Spec' have the same erasure, yet neither overrides 
> the other.
>  @ line 8, column 5.
>        @Override
>        ^
> 1 error
> {code}
> The two signatures in the message are identical. This worked fine in Groovy 4 
> and compiles
> under {{javac}} as well.
> Renaming {{{}Box{}}}'s own type variable fixes it, with nothing else changed:
> {code:groovy}
> interface Box<X> { }
> {code}
> So the check appears to be keying on the name.
> Only the interface side matters. If the interface declares
> {{<D extends Number> void m(Box<? super D> b)}} and the class declares
> {{{}<T extends Number> void m(Box<? super T> b){}}}, it compiles.
> Because it keys on the name, whether a type trips it depends on what that 
> type happens to
> call its own type variable. With a method variable named {{{}T{}}}, 
> {{{}Consumer{}}}, {{{}Supplier{}}},
> {{{}Function{}}}, {{Comparator}} and {{Iterable}} all fail, while 
> {{{}List<E>{}}}, {{Collection<E>}}
> and {{Callable<V>}} are fine. {{List}} fails too once the method variable is 
> renamed to {{{}E{}}}.
> It also does not matter whether the supertype is a Java interface, a Groovy 
> interface or a
> Groovy abstract class, or whether it is precompiled.
> This bisects to 5.0.0-beta-1: 5.0.0-alpha-12 compiles it and 5.0.0-beta-1 
> does not. That is
> the fix version of GROOVY-11550, which added
> {{ClassCompletionVerifier#checkMethodsForOverridingIssue}} in
> [https://github.com/apache/groovy/commit/a3c59394977fd9feb5220812f62b6fd0b60a0739].
>  That seems likely to be the cause of the issue in some manner.
> This was shrunk from real code in Gradle. 
> {{org.gradle.api.problems.ProblemSpec}} declares:
> {code:java}
> <T extends AdditionalData> ProblemSpec additionalData(Class<T> type, Action<? 
> super T> config);
> {code}
> and {{org.gradle.api.Action}} also names its type variable {{{}T{}}}, so no 
> Groovy 5 class can
> implement it.
> [https://github.com/gradle/gradle/blob/216ed75ae0d82b8bd1fdd3880f7e752f58e7aba9/platforms/ide/problems-api/src/main/java/org/gradle/api/problems/ProblemSpec.java#L162]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to