8194892: add compiler support for local-variable syntax for lambda parameters

Reviewed-by: mcimadamore
This commit is contained in:
Vicente Romero 2018-02-20 11:45:16 -05:00
parent c37e80c84f
commit 2591c21c01
15 changed files with 418 additions and 76 deletions

View file

@ -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;
}