mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 17:07:05 +07:00
method references: exclude type parameter used in return types only (IDEA-171480)
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
abstract class View<Tv, Av, Bv> {
|
||||
|
||||
public Const<Av, Tv> apply(final Fixed<Tv, Av, Bv, Const<Av, Tv>, Const<Av, Bv>> fix) {
|
||||
return fix.apply(Const::new);
|
||||
}
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
interface Fixed< T, A, B,
|
||||
FT extends Functor<T>,
|
||||
FB extends Functor<B>> {
|
||||
FT apply(Function< A, FB> function);
|
||||
}
|
||||
|
||||
interface Functor<A> {
|
||||
}
|
||||
|
||||
final class Const<A, B> implements Functor<B> {
|
||||
A a;
|
||||
|
||||
public Const(A a) {
|
||||
this.a = a;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user