Mattias Reichel created GROOVY-12091:
----------------------------------------

             Summary: Regression in Groovy 5: bounded generic trait property 
setter remains abstract in implementing class
                 Key: GROOVY-12091
                 URL: https://issues.apache.org/jira/browse/GROOVY-12091
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 5.0.6
            Reporter: Mattias Reichel


 

This example compiles with Groovy 4
{code:java}
trait FooTrait<F extends Serializable> {
    F foo
}
class Bar implements Serializable, FooTrait<Bar> {
    String name
}
{code}
but results in

 
{code:java}
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
ideaGroovyConsole.groovy: 5: Can't have an abstract method in a non-abstract 
class. The class 'Bar' must be declared abstract or the method 'F 
FooTrait__foo$set(F)' must be implemented.
 @ line 5, column 1.
   class Bar implements Serializable, FooTrait<Bar> {
   ^
1 error
{code}
with Groovy 5.

 



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

Reply via email to