mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +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);
|
||||
}
|
||||
}
|
||||
+4
@@ -99,6 +99,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testGroundTargetTypeForImplicitLambdas() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user