mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
var -> explicit: fix lambdas with multiple parameters (IDEA-194414)
This commit is contained in:
+9
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
+13
@@ -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) -> {});
|
||||
}
|
||||
}
|
||||
+9
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user