jdk-24/langtools/test/tools/javac/lambda/VoidLambdaParameter.java
Jan Lahoda 0f0e04b6a0 8028235: Better error recovery for parsing 'void' as a type of the lambda parameter
Handle "void" as a primitive type in JavacParser.analyzeParens.

Reviewed-by: vromero
2013-12-17 10:58:26 +01:00

13 lines
371 B
Java

/* @test /nodynamiccopyright/
* @bug 8028235
* @summary Using void as a lambda parameter should produce sane AST and errors
* @compile/fail/ref=VoidLambdaParameter.out -XDrawDiagnostics VoidLambdaParameter.java
*/
public class VoidLambdaParameter {
Runnable r = (void v) -> { };
I i = (void v) -> { };
interface I {
public void v(void v);
}
}