You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Puneet Behl (Jira)" <ji...@apache.org> on 2020/02/20 18:43:00 UTC

[jira] [Created] (GROOVY-9414) Groovy 3.0.2-SNAPSHOT : Delegate does not work with getter

Puneet Behl created GROOVY-9414:
-----------------------------------

             Summary: Groovy 3.0.2-SNAPSHOT : Delegate does not work with getter
                 Key: GROOVY-9414
                 URL: https://issues.apache.org/jira/browse/GROOVY-9414
             Project: Groovy
          Issue Type: Bug
          Components: Compiler
    Affects Versions: 3.0.1
         Environment: macOS Catalina
Version: 10.15.3
            Reporter: Puneet Behl


It looks like the default getter for a property is not picked up by the @{{Delegate}}. For example the below code:
{code:groovy}
interface Foo {
    String getName()
}

class Bar {
    String name
}

class FooImpl implements Foo {
    @Delegate(includes = "getName") Bar bar
}
{code}
throws a compile-time error as:
{code:java}
1 compilation error:

Error during @Delegate processing: 'includes' property or method 'getName' does not exist.
 at line: 10, column: 5
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)