8199327: nuke var type name after a lambda has been accepted

Reviewed-by: mcimadamore
This commit is contained in:
Vicente Romero 2018-03-08 10:28:46 -05:00
parent 254138139f
commit c866d037bc
2 changed files with 9 additions and 1 deletions

View file

@ -1,6 +1,6 @@
/*
* @test /nodynamiccopyright/
* @bug 8198512
* @bug 8198512 8199327
* @summary compiler support for local-variable syntax for lambda parameters
* @compile/fail/ref=VarInImplicitLambdaNegTest01.out -XDrawDiagnostics VarInImplicitLambdaNegTest01.java
*/
@ -14,5 +14,8 @@ class VarInImplicitLambdaNegTest01 {
IntBinaryOperator f4 = (int x, y) -> x + y; // error explicit and implicit
BiFunction<String[], String, String> f5 = (var s1[], var s2) -> s2; // error var and array
// correct use
IntBinaryOperator f6 = (var x, var y) -> x + y; // ok
BiFunction<Function<String, String>, String, String> f = (Function<String, String> s1, String s2) -> s2; // ok
}