mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
new inference: include containing class params for constructor refs
(cherry picked from commit be696513a9ed7e418385a25a879b1e0373dd4cf2)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
interface Supplier<T> {
|
||||
T get();
|
||||
}
|
||||
|
||||
interface Collector<T, A, R> {}
|
||||
<R, A> R collect(Collector<? super Integer, A, R> collector) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T, C extends Collection<T>> Collector<T, ?, C> toCollection(Supplier<C> collectionFactory) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T> Collector<T, ?, List<T>> toList() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void test() {
|
||||
List<Integer> l1 = collect(toList());
|
||||
List<Integer> l2 = collect(toCollection(ArrayList::new));
|
||||
m(collect(toList()));
|
||||
m(collect(toCollection(ArrayList::new)));
|
||||
}
|
||||
|
||||
void m(List<Integer> l) { }
|
||||
}
|
||||
Reference in New Issue
Block a user