RFR: 8345438: Invalid error for return in early construction context lambda
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed Dec 4 11:51:40 UTC 2024
On Wed, 4 Dec 2024 02:19:24 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> The "Flexible Constructors" JEP feature allows statements to appear before a `super()` invocation, but some restrictions, one of which is that `return` is not allowed. The compiler check for this was being too strict in that it was incorrectly disallowing a `return` statement that was nested inside a lambda, which is OK.
>
> Please review this patch to the `SuperThisChecker` which fixes this.
Looks good. I was a bit worried re. setting `scanDepth = 0`, but I see that the `costructor` check dominates everything else.
-------------
Marked as reviewed by mcimadamore (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/22531#pullrequestreview-2478316461
More information about the compiler-dev
mailing list