Integrated: 8345438: Invalid error for return in early construction context lambda

Archie Cobbs acobbs at openjdk.org
Wed Dec 4 23:20:48 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.

This pull request has now been integrated.

Changeset: 7a0cc796
Author:    Archie Cobbs <acobbs at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/7a0cc796689a5c50e5b41fa4369640806b92d52e
Stats:     129 lines in 5 files changed: 127 ins; 0 del; 2 mod

8345438: Invalid error for return in early construction context lambda

Reviewed-by: vromero, mcimadamore

-------------

PR: https://git.openjdk.org/jdk/pull/22531


More information about the compiler-dev mailing list