lambda: ground target type for implicit lambda

This commit is contained in:
Anna Kozlova
2014-01-28 17:56:01 +04:00
parent 32094bf637
commit 40f3ae8e6e
6 changed files with 91 additions and 12 deletions
@@ -0,0 +1,38 @@
import java.util.List;
interface TT<T extends List<T>> {
boolean p(T t);
}
class TU {
void foo(TT<? extends List<?>> k){}
{
foo(<error descr="Cannot infer functional interface type">x -> false</error>);
}
}
interface TT1<T extends List<?>> {
boolean p(T t);
}
class TU1 {
void foo(TT1<? extends List<?>> k){}
{
foo(x -> false);
}
}
interface TT2<T> {
boolean p(T t);
}
class TU2 {
void foo(TT2<? extends List<?>> k){}
{
foo(x -> false);
}
}