You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2020/11/15 15:30:00 UTC

[jira] [Created] (GROOVY-9816) @AutoImplement does not consider declared properties

Eric Milles created GROOVY-9816:
-----------------------------------

             Summary: @AutoImplement does not consider declared properties
                 Key: GROOVY-9816
                 URL: https://issues.apache.org/jira/browse/GROOVY-9816
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 3.0.6, 2.5.13
            Reporter: Eric Milles
            Assignee: Eric Milles


Consider the following:
{code:groovy}
interface I {
  def getX()
  void setX(x)
}

@groovy.transform.AutoImplement
class C implements I {
  def x
}

def c = new C()
c.x = 123
print c.x
{code}

This script outputs "null" instead of the expected "123".  {{@AutoImplement}} is generating {{getX()}} and {{setX(x)}} methods in place of the canonical generated methods for the property {{x}}.



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