Eric Milles created GROOVY-11567:
------------------------------------
Summary: Field transform does not handle closure or anonymous
class in assert, return, etc.
Key: GROOVY-11567
URL: https://issues.apache.org/jira/browse/GROOVY-11567
Project: Groovy
Issue Type: Bug
Reporter: Eric Milles
Assignee: Eric Milles
Consider the following:
{code:groovy}
@Field String foo = 'bar'
assert({ ->
new Object() {
String toString() { foo + 'baz' }
}
}.call().toString() == 'barbaz')
{code}
Not the best example, but this fails with an NPE in the compiler. The
{{@Field}} transform navigates expression statements, but not other statement
types.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)