mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
new inference: nested varargs
(cherry picked from commit 0d293e439ffcbe97db98c1a1b8072e798d94323e)
This commit is contained in:
@@ -7,7 +7,7 @@ class A<T> {
|
||||
foo(new A<>("", ""));
|
||||
bar(new A<>("", ""));
|
||||
bar(new A<>(get()));
|
||||
//bar(new A<>(get( ), ""));
|
||||
bar(new A<>(get( ), ""));
|
||||
}
|
||||
|
||||
void foo(A<String> s) {}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
class Demo {
|
||||
|
||||
public void f1() {
|
||||
f2<error descr="'f2()' in 'Demo' cannot be applied to '(int, <lambda expression>)'">(2, input -> input)</error>;
|
||||
f2(2, <error descr="Target type of a lambda conversion must be an interface">input -> input</error>);
|
||||
}
|
||||
|
||||
public void f2() {
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
import java.util.List;
|
||||
|
||||
abstract class StreamMain {
|
||||
public abstract <T> Iterable<T> concat(final Iterable<? extends T>... iterables);
|
||||
public abstract <T> Iterable<T> concat(final List<? extends T>... iterables);
|
||||
|
||||
public final List<String> errorFixesToShow = null;
|
||||
public final List<String> inspectionFixesToShow = null;
|
||||
|
||||
void foo() {
|
||||
exists(concat(errorFixesToShow, inspectionFixesToShow), "");
|
||||
}
|
||||
|
||||
public abstract <T> boolean exists(T[] iterable, T t);
|
||||
public abstract <T> boolean exists(Iterable<T> iterable, T t);
|
||||
|
||||
}
|
||||
|
||||
|
||||
abstract class StreamMainComplexSecendArgument {
|
||||
public abstract <T> Iterable<T> concat(final Iterable<? extends T>... iterables);
|
||||
public abstract <T> Iterable<T> concat(final List<? extends T>... iterables);
|
||||
|
||||
|
||||
public final List<String> errorFixesToShow = null;
|
||||
public final List<String> inspectionFixesToShow = null;
|
||||
|
||||
void foo() {
|
||||
Condition<String> condition = new Condition<String>() {
|
||||
@Override
|
||||
public boolean value(String s) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
exists(concat(errorFixesToShow, inspectionFixesToShow), condition);
|
||||
}
|
||||
|
||||
public abstract <T> boolean exists(T[] iterable, Condition<T> condition);
|
||||
|
||||
public abstract <T> boolean exists(Iterable<T> iterable, Condition<T> condition);
|
||||
|
||||
|
||||
interface Condition<T> {
|
||||
boolean value(T t);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user