Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
import groovy.transform.* @CompileStatic @ToString(includeFields=true) class Foo { List<String> propWithGen = ['propWithGen'] ?: [] List propNoGen = ['propNoGen'] ?: [] private List<String> fieldGen = ['fieldGen'] ?: [] def bar() { this.propNoGen = ['notDecl'] ?: [] // not applicable here List<String> localVar = ['localVar'] ?: [] localVar } } def foo = new Foo() assert foo.bar() == ['localVar'] assert foo.toString() == 'Foo([propWithGen], [notDecl], [fieldGen])'
Attachments
Issue Links
- links to