var -> explicit: fix lambdas with multiple parameters (IDEA-194414)

This commit is contained in:
Anna Kozlova
2018-06-22 18:15:50 +03:00
parent e7743c0b00
commit 17095a1640
5 changed files with 79 additions and 11 deletions
@@ -0,0 +1,9 @@
// "Replace 'var' with explicit type" "true"
import java.util.function.BiFunction;
final class Example {
void m() {
BiFunction<Integer, ? extends String, Integer> graph = (Integer x1, String x) -> x1*2;
}
}
@@ -0,0 +1,13 @@
// "Replace 'var' with explicit type" "false"
final class Example<J, T> {
interface I<A, B> {
void m(A a, B b);
}
void m(I<T, J> i) {}
void m(Example<? super String, Integer> e) {
e.m((var a, v<caret>ar b) -> {});
}
}
@@ -0,0 +1,9 @@
// "Replace 'var' with explicit type" "true"
import java.util.function.BiFunction;
final class Example {
void m() {
BiFunction<Integer, ? extends String, Integer> graph = (var x1, v<caret>ar x) -> x1*2;
}
}