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

Eric Milles updated GROOVY-7288:
--------------------------------
    Fix Version/s:     (was: 5.0.0-alpha-1)

> @Delegate to object by Class which implementing trait with fields complains 
> 'abstract method in a non-abstract class'
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-7288
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7288
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.3.6
>            Reporter: Pavel Alexeev
>            Assignee: Eric Milles
>            Priority: Major
>              Labels: trait, traits
>             Fix For: 3.0.11, 4.0.2
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Please look at short reproduce:
> {code}
> import groovy.transform.TupleConstructor
> trait Some{
>     String STATIC = 'static data' // Commenting it out make it work (it have 
> no difference static it or not)
>     String so(){
>         println ('STATIC=' + STATIC)
>     }
> }
> class Delegator implements Some{
>     String delegated(){
>         println 'delegated work'
>     }
> }
> class SomeClass{
>     @Delegate Delegator delegator = new Delegator();
> }
> def s = new SomeClass()
> s.delegated()
> {code}
> Running it I have:
> {noformat}
> 2 compilation errors:
> Can't have an abstract method in a non-abstract class. The class 'SomeClass' 
> must be declared abstract or the method 'java.lang.String Some__STATIC$get()' 
> must be implemented.
>  at line: 17, column: 1
> Can't have an abstract method in a non-abstract class. The class 'SomeClass' 
> must be declared abstract or the method 'void 
> Some__STATIC$set(java.lang.String)' must be implemented.
>  at line: 17, column: 1
> {noformat}



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

Reply via email to