Paul King created GROOVY-11814:
----------------------------------

             Summary: ToString transform should be enum aware
                 Key: GROOVY-11814
                 URL: https://issues.apache.org/jira/browse/GROOVY-11814
             Project: Groovy
          Issue Type: Bug
            Reporter: Paul King


 Although it may not be common to use @ToString for an enum, it is supported:
{code:groovy}
@ToString(includeNames = true)
enum Foo {
   Bar(prop: 'val1'), Baz(prop: 'val2')
   final String prop
}
{code}

The current behavior has the classname hard-coded and produces:
{code:groovy}
println Foo.Bar // Foo(prop:val1)
println Foo.Baz // Foo(prop:val2)
{code}

The suggested behavior is:
{code:groovy}
println Foo.Bar // Bar(prop:val1)
println Foo.Baz // Baz(prop:val2)
{code}



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

Reply via email to