daniellansun commented on PR #3054:
URL: https://github.com/apache/groovy/pull/3054#issuecomment-6473194077
@eric-milles Thanks for the follow-up.
**2.** Agreed — getting `Object[] a = { {} }` off the NPE path is the
important win. Remaining mismatched-dimension / multi-expression nested cases
can be separate tickets rather than blockers for this PR.
**3.** If the new caret lines up with the other similar recovery messages,
I’m fine leaving the negative tests as updated.
**4.** Thanks for writing the list — I’ll follow that thread.
**1** is still my main merge concern: `Closure[] a = { println('x') }` (and
similar non-command-chain Runnable/Callable bodies) running at initialisation
and storing `null` is a silent behaviour change. COMPATIBILITY covers the
empty-`{}` promotion flip, but not that eager-eval case. Until the list settles
A vs B, I’d still like either a compile-time diagnostic for Closure/SAM leaves,
or path B (array reading except empty/singleton when the leaf is Closure/SAM,
and possibly Object), plus tests for `{}` / `{ it }` / `{ -> }` / `{ { } }` /
`Runnable[]` / `Object[]` / `@CompileStatic`.
**5.** Happy with the terse form in the docs; a short explicit rule on the
differences/syntax pages for when a non-empty `{…}` body is an array vs a
closure (and how to spell the old promotion) would still help.
Happy to re-review quickly once the list direction is clear, or if you push
diagnostics / B.
--
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]