new inference: no substitution during most specific inference by means of new spec (IDEA-127584)

This commit is contained in:
Anna Kozlova
2014-07-21 17:56:20 +02:00
parent fb786d36c0
commit 89dc528242
4 changed files with 40 additions and 15 deletions
@@ -0,0 +1,22 @@
class Test {
public static <Tfoo, Vfoo> Future<Vfoo> foo(Future<Tfoo> future, Function<Tfoo, Vfoo> function) {
return future.map(function);
}
// These interfaces inspired by FoundationDB Java client class files
interface PartialFunction <TP, VP> {
VP apply(TP t) throws java.lang.Exception;
}
interface Function <TF, VF> extends PartialFunction<TF, VF> {
VF apply(TF t);
}
interface PartialFuture <TPP> {
<VPP> PartialFuture<VPP> map(PartialFunction<TPP, VPP> partialFunction);
}
interface Future <TFF> extends PartialFuture<TFF> {
<VFF> Future<VFF> map(Function<TFF, VFF> function);
}
}