[ 
https://issues.apache.org/jira/browse/GROOVY-11736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mattias Reichel updated GROOVY-11736:
-------------------------------------
    Description: 
This class hierarchy compiles successfully with Groovy 4.0.28.
(It is used in the Grails codebase)
{code:java}
class A implements Collection {

    @Delegate Collection target

    A(Collection target) {
        this.target = target
    }
}

class B extends A implements Set {

    @Delegate Set target

    B(Set target) {
        super(target)
        this.target = target
    }
}{code}
In Groovy 5.0.0-rc-1 it fails to compile with the following error message:
{code:java}
10: The interface Collection cannot be implemented more than once with 
different arguments: java.util.Collection<java.lang.Object> and 
java.util.Collection
. At [10:1]  @ line 10, column 1.
   class B extends A implements Set {
   ^1 error{code}

  was:
This class hierarchy compiles successfully with Groovy 4.0.28.
(It is used in the Grails codebase)
{code:java}
class A implements Collection {

    @Delegate final Collection target

    A(Collection target) {
        this.target = target
    }
}

class B extends A implements Set {

    @Delegate Set target

    B(Set target) {
        super(target)
        this.target = target
    }
}{code}
In Groovy 5.0.0-rc-1 it fails to compile with the following error message:
{code:java}
10: The interface Collection cannot be implemented more than once with 
different arguments: java.util.Collection<java.lang.Object> and 
java.util.Collection
. At [10:1]  @ line 10, column 1.
   class B extends A implements Set {
   ^1 error{code}


> Compile error in Groovy 5
> -------------------------
>
>                 Key: GROOVY-11736
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11736
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 5.0.0-rc-1
>            Reporter: Mattias Reichel
>            Priority: Major
>
> This class hierarchy compiles successfully with Groovy 4.0.28.
> (It is used in the Grails codebase)
> {code:java}
> class A implements Collection {
>     @Delegate Collection target
>     A(Collection target) {
>         this.target = target
>     }
> }
> class B extends A implements Set {
>     @Delegate Set target
>     B(Set target) {
>         super(target)
>         this.target = target
>     }
> }{code}
> In Groovy 5.0.0-rc-1 it fails to compile with the following error message:
> {code:java}
> 10: The interface Collection cannot be implemented more than once with 
> different arguments: java.util.Collection<java.lang.Object> and 
> java.util.Collection
> . At [10:1]  @ line 10, column 1.
>    class B extends A implements Set {
>    ^1 error{code}



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

Reply via email to