mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
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:
parent
92c25244aa
commit
0f0e04b6a0
4 changed files with 60 additions and 3 deletions
12
langtools/test/tools/javac/lambda/VoidLambdaParameter.java
Normal file
12
langtools/test/tools/javac/lambda/VoidLambdaParameter.java
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue