[
https://issues.apache.org/jira/browse/GROOVY-11814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18042053#comment-18042053
]
ASF GitHub Bot commented on GROOVY-11814:
-----------------------------------------
paulk-asert opened a new pull request, #2350:
URL: https://github.com/apache/groovy/pull/2350
(no comment)
> 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
> Priority: Major
>
> 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)