RFR: 8335136: Underscore as parameter name in one-parameter functional types fails to compile

Evemose duke at openjdk.org
Wed Jun 26 09:37:37 UTC 2024


On Tue, 25 Jun 2024 11:22:00 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> Hi,
> 
> the change looks sensible to me, thanks. A test will be needed, though. One possible location for the test may be `test/langtools/tools/javac/switchexpr/ExpressionSwitch.java`.

I have added testcase, but in separate class. As described in ExpressionSwitch, this class specializes on testing behaviour of nexted switch expresssions, and also all of them are valid by default. So i decided to create new class, and also added some negative tests for underscore after yield as it is now a valid follow-up token, so it will guard from unexpected bugs in javac related to underscore in yield from now on. Also, now or test to run I have added random bug id, because itherwise runner wont start. I have added a TODO to replace it with actual one when the issue is published

PS: I have tried to use record patterns in for loop, but compilation of test failed for some reason. Not surew if its expected behaviour or not.

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

PR Comment: https://git.openjdk.org/jdk/pull/19878#issuecomment-2189085398


More information about the compiler-dev mailing list