mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8194892: add compiler support for local-variable syntax for lambda parameters
Reviewed-by: mcimadamore
This commit is contained in:
parent
c37e80c84f
commit
2591c21c01
15 changed files with 418 additions and 76 deletions
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8194892
|
||||
* @summary add compiler support for local-variable syntax for lambda parameters
|
||||
* @compile/fail/ref=VarInImplicitLambdaNegTest01.out -XDrawDiagnostics VarInImplicitLambdaNegTest01.java
|
||||
*/
|
||||
|
||||
import java.util.function.*;
|
||||
|
||||
class VarInImplicitLambdaNegTest01 {
|
||||
IntBinaryOperator f1 = (x, var y) -> x + y;
|
||||
IntBinaryOperator f2 = (var x, y) -> x + y;
|
||||
IntBinaryOperator f3 = (int x, var y) -> x + y;
|
||||
IntBinaryOperator f4 = (int x, y) -> x + y;
|
||||
|
||||
BiFunction<String[], String, String> f5 = (var s1[], var s2) -> s2;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue