mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
lambda: ground target type for implicit lambda
This commit is contained in:
+38
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user