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

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

testlens-app[bot] commented on PR #2733:
URL: https://github.com/apache/groovy/pull/2733#issuecomment-5071144522

   ## ✅ All tests passed ✅
   
   🏷️ Commit: 3334e37d35d093063d4e0763a0eed3014d9f23ee
   ▶️ Tests:  105866 executed
   ⚪️ Checks: 31/31 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   




> Incorrect "abstract method not implemented … same name but different return 
> type" error for a valid covariant override
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12188
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12188
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 5.0.7
>            Reporter: Octavia Togami
>            Assignee: Paul King
>            Priority: Major
>
> The following code in a `Repro.groovy` will cause the error:
> {code:groovy}
> abstract class ProviderSpec<T> {
>     abstract T someValue()
> }
> abstract class CollectionPropertySpec<C extends Collection<String>> extends 
> ProviderSpec<C> {
>     C someValue() { return null }
>     static class Nested<T> {
>         // This method is required to trigger the bug, for some reason.
>         void trigger(Optional<T> p) { p.map { it } }
>     }
> }
> class DefaultListPropertyTest extends CollectionPropertySpec<List<String>> {
> }
> {code}
> {code:sh}
> $ groovyc Repro.groovy 
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> Repro.groovy: 2: Abstract method 'T someValue()' is not implemented but a 
> method of the same name but different return type is defined: method 'C 
> someValue()'
>  @ line 2, column 5.
>        abstract T someValue()
>        ^
> 1 error
> {code}
> This worked fine in Groovy 4 and appears to be correct code as it compiles 
> under {{javac}} as well.
> This was shrunk from real code in Gradle, located at 
> https://github.com/gradle/gradle/blob/adbe2eb8a092ed6f92ea3d693d32769b553151e9/platforms/core-configuration/model-core/src/test/groovy/org/gradle/api/internal/provider/CollectionPropertySpec.groovy#L49
>  .



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

Reply via email to