RFR: 8301374: NullPointerException in MemberEnter.checkReceiver [v2]

Vicente Romero vromero at openjdk.org
Tue Feb 14 17:58:19 UTC 2023


On Tue, 14 Feb 2023 16:01:00 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   addressing review comments
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java line 3726:
> 
>> 3724:                 if (pn.hasTag(Tag.IDENT) && ((JCIdent)pn).name != names._this) {
>> 3725:                     name = ((JCIdent)pn).name;
>> 3726:                 } else if (lambdaParameter) {
> 
> I wonder if we could help the error recovery a little bit more, like e.g.:
> 
>                 } else if (lambdaParameter && type == null) {
>                     // we have a lambda parameter that is not an identifier this is a syntax error
>                     type = pn;
>                     name = names.empty;
>                     reportSyntaxError(pos, Errors.Expected(IDENTIFIER));
>                 } else {
> 
> 
> Which would keep the parsed thing as a type for the lambda parameter?

yep I like this suggestion. I have updated the PR accordingly, thanks!

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

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


More information about the compiler-dev mailing list