lambda: stop inference from lambda if return type retrieval leads to second lambda inference; do not cache types during this calculation

This commit is contained in:
anna
2013-02-20 20:41:06 +01:00
parent 3595385432
commit 9634bb390e
4 changed files with 40 additions and 3 deletions
@@ -0,0 +1,27 @@
import java.util.*;
public class Main1 {
interface I<T> {
List<T> f();
}
static class Test {
<Z> void m(I<Z> i, I<Z> ii) {
}
<Z> void m(I<Z> s) {
}
{
m(() -> emptyList(), () -> new ArrayList<String>());
m(() -> new ArrayList<String>(), () -> emptyList());
m((I<String>) () -> emptyList(), () -> new ArrayList<String>());
m(() -> Test.<String>emptyList(), () -> new ArrayList<String>());
m(() -> emptyList());
}
static <T> List<T> emptyList() {
return null;
}
}
}