equal
deleted
inserted
replaced
|
1 /* |
|
2 * @test /nodynamiccopyright/ |
|
3 * @bug 8198512 |
|
4 * @summary compiler support for local-variable syntax for lambda parameters |
|
5 * @compile/fail/ref=VarInImplicitLambdaNegTest01.out -XDrawDiagnostics VarInImplicitLambdaNegTest01.java |
|
6 */ |
|
7 |
|
8 import java.util.function.*; |
|
9 |
|
10 class VarInImplicitLambdaNegTest01 { |
|
11 IntBinaryOperator f1 = (x, var y) -> x + y; // error implicit and var |
|
12 IntBinaryOperator f2 = (var x, y) -> x + y; // error var and implicit |
|
13 IntBinaryOperator f3 = (int x, var y) -> x + y; // error var and explicit |
|
14 IntBinaryOperator f4 = (int x, y) -> x + y; // error explicit and implicit |
|
15 |
|
16 BiFunction<String[], String, String> f5 = (var s1[], var s2) -> s2; // error var and array |
|
17 BiFunction<Function<String, String>, String, String> f = (Function<String, String> s1, String s2) -> s2; // ok |
|
18 } |