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
This commit is contained in:
Jan Lahoda 2013-12-17 10:58:26 +01:00
parent 92c25244aa
commit 0f0e04b6a0
4 changed files with 60 additions and 3 deletions

View file

@ -0,0 +1,12 @@
/* @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);
}
}