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

Jan Lahoda jlahoda at openjdk.org
Wed Jun 26 09:37:36 UTC 2024


On Tue, 25 Jun 2024 10:38:37 GMT, Evemose <duke at openjdk.org> wrote:

> Seems like this bug been around for quite a bunch of time now. Basically, in JavacParser, UNDERSCORE case havent been present in block parsing switch statement, so it was treated as default and it wasnt recognized as part of yield statement. This simple fix adds UNDERSCORE case right next to IDENTIFIER case to solve this problem. Syntax like yield _ = 3 is still invalid.

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`.

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

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


More information about the compiler-dev mailing list