testdata for IDEA-122074, IDEA-122084

(cherry picked from commit 582e8846460cb5f4c20d271cdf7894e557bc6e02)
This commit is contained in:
Anna Kozlova
2014-03-13 15:15:02 +01:00
parent 8f39cbc216
commit d03d73ed7d
3 changed files with 41 additions and 0 deletions
@@ -0,0 +1,15 @@
class CyclicInferenceBug {
interface Func1<T1, R> {
R apply(T1 v1);
void other();
}
interface F1<T1, R> extends Func1<T1, R> {
default void other() {}
}
<T1, R> Func1<T1, R> func(F1<T1, R> f1) { return f1; }
void test() {
Func1<String, String> f1 = func(s -> s);
}
}
@@ -0,0 +1,18 @@
class InferenceFailBug {
interface Func1<T1, R> {
R apply(T1 v1);
void other();
}
interface F1<T1, R> extends Func1<T1, R> {
default void other() {}
}
<T1, R> Func1<T1, R> func(F1<T1, R> f1) { return f1; }
interface Future<T> {
<R> Future<R> map(Func1<T, R> f1);
}
private Future<Integer> futureExample(Future<String> future) {
return future.map(func(s -> s.toUpperCase())).map(func(s -> s.length()));
}
}