Integrated: 8333107: javac fails with an exception when processing broken lambda
Jan Lahoda
jlahoda at openjdk.org
Thu May 30 13:56:07 UTC 2024
On Wed, 29 May 2024 10:56:25 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> When javac encounters a broken code around lambda, it attempts to recover from the problem. One possible problem is a missing return (when the lambda is no expected to be void-compatible), or a return with a value (when the lambda is expected to be void compatible). The recovery attempts to adjust the lambda to conform to the expectations, so it can be attributed.
>
> It tries to not touch embedded lambdas and classes, but it does not do that correctly - it just does nothing at all for these. But `TreeTranslator` will then replace the embedded lambdas and classes with `null`, leading to problems when the translated tree is processed/attributed.
>
> The proposed solution is to correctly retain the existing trees for embedded lambdas and classes by copying the trees to the `result` variable.
This pull request has now been integrated.
Changeset: 4acafb80
Author: Jan Lahoda <jlahoda at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/4acafb809c66589fbbfee9c9a4ba7820f848f0e4
Stats: 50 lines in 2 files changed: 48 ins; 0 del; 2 mod
8333107: javac fails with an exception when processing broken lambda
Reviewed-by: asotona
-------------
PR: https://git.openjdk.org/jdk/pull/19451
More information about the compiler-dev
mailing list