Hello, javac is not able to parse "yield _ -> ...". Here is a reproducer. public class SwitchYieldAndUnderscore { public static void main(String[] args) { Consumer<String> value = switch (args[0]) { case "foo" -> { yield _ -> {}; } default -> throw new AssertionError(); }; } } regards, Rémi