RFR: 8301374: NullPointerException in MemberEnter.checkReceiver [v2]
Jan Lahoda
jlahoda at openjdk.org
Tue Feb 14 18:34:44 UTC 2023
On Tue, 14 Feb 2023 17:58:19 GMT, Vicente Romero <vromero at openjdk.org> wrote:
>> the following incorrect code is crashing javac:
>>
>> public class X {
>> interface F {
>> void apply(E e);
>> }
>> enum E {
>> ONE
>> }
>>
>> F f = (E.ONE) -> {}; // E.ONE?
>> }
>>
>> there are several issues the incorrect argument to this lambda expression. The proposed solution is to issue a syntax error for the missing parameter name. IMO, this error message would be correct here and this way the compiler fails fast instead of having to deal with an erroneous lambda later on to avoid a crash like the one we have now,
>>
>> TIA
>
> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>
> addressing review comments
Looks good to me!
-------------
Marked as reviewed by jlahoda (Reviewer).
PR: https://git.openjdk.org/jdk/pull/12523
More information about the compiler-dev
mailing list