codeconsole commented on PR #16292:
URL: https://github.com/apache/grails-core/pull/16292#issuecomment-5667819054
Addressed in `fbfe7a17`. 378 module tests, checkstyle clean, examples and
in-tree `beans = { }` users green.
**[P3] nested anonymous class** — all five of your rows reproduced first,
then a sixth you did not list, which changed the shape of the fix: **a
`@CompileStatic` method on the nested class does not rescue it** —
`@CompileStatic` host / `@CompileDynamic` outer method / `@CompileStatic` inner
method still fails with `NoSuchFieldError`. So the enclosing body is a
**ceiling**, not a default: a method's own annotation can lower the answer
beneath it but never raise it. `null` keeps the round-5 behaviour for a class
whose only enclosing body is the lifted bean method, where the chain decides
and a method may still raise it.
Both of your changes landed, with one adjustment. The nested class inherits
`baseOwn` rather than the body's set — passing the body's set would hand the
statics over before the nested class's own answer is consulted, which is the
double route you flagged; going through `baseOwn` closes it without needing the
sets to agree. `walkBody` returns the classes found in the body it walked
instead of appending to one shared list, which is what lets each carry its
answer down.
Four rows pin it: the sibling and group shapes, the inner-`@CompileStatic`
shape, and the plain-method control that compiles and returns `hello`.
Reverting the ceiling fails exactly the three rejection rows and leaves the
control green. All six shapes now agree with what the runtime does.
Javadoc line reflowed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]