new inference: default constructor as poly expression argument

This commit is contained in:
Anna Kozlova
2013-09-20 20:36:37 +04:00
parent ee56497e3d
commit f415702127
3 changed files with 66 additions and 26 deletions
@@ -0,0 +1,21 @@
class Main2 {
<R> void bar(Fun<Integer, R> collector) { }
<T, D> Fun<T, Integer> foo(D d) { return null; }
public void test() {
bar(new Foo<>());
}
interface Fun<T, R> {
R _(T t);
}
class Foo<K> implements Fun<K, Integer> {
@Override
public Integer _(K k) {
return null;
}
}
}