mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
method ref: accept non parameterized receivers (IDEA-101168)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
class IDEA101168<E> {
|
||||
|
||||
public void foo(Stream<OfPrimitive<E>> stream, Collector<CharSequence, Double> collector) {
|
||||
stream.map(Object ::toString).collect(collector);
|
||||
}
|
||||
|
||||
interface OfPrimitive<A> {
|
||||
}
|
||||
|
||||
interface Collector<T, R> {
|
||||
interface OfInt<R> extends Collector<Integer, R> {
|
||||
}
|
||||
}
|
||||
|
||||
interface Stream<T> extends BaseStream<T> {
|
||||
<R> Stream<R> map(Function<? super T, ? extends R> mapper);
|
||||
IntStream map(ToIntFunction<? super T> mapper);
|
||||
<R> R collect(Collector<? super T, R> collector);
|
||||
}
|
||||
|
||||
interface Function<T, R> {
|
||||
public R apply(T t);
|
||||
}
|
||||
|
||||
interface ToIntFunction<T> {
|
||||
public int applyAsInt(T t);
|
||||
}
|
||||
|
||||
interface IntStream extends BaseStream<Integer> {
|
||||
<R> R collect(Collector.OfInt<R> collector);
|
||||
}
|
||||
interface BaseStream<T> {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user