mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 16:39:37 +07:00
pertinent to applicability: reject nested lambdas if they target non proper type
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<error descr="Multiple non-overriding abstract methods found">@FunctionalInterface</error>
|
||||
<error descr="Multiple non-overriding abstract methods found in interface Test">@FunctionalInterface</error>
|
||||
interface Test {
|
||||
void foo();
|
||||
void bar();
|
||||
|
||||
@@ -36,7 +36,7 @@ class Test2 {
|
||||
}
|
||||
|
||||
{
|
||||
F f = <error descr="Multiple non-overriding abstract methods found">() -> g()</error>;
|
||||
F f = <error descr="Multiple non-overriding abstract methods found in interface Test2.F">() -> g()</error>;
|
||||
}
|
||||
|
||||
void g() {}
|
||||
|
||||
@@ -8,7 +8,7 @@ public class NotAFIT {
|
||||
}
|
||||
|
||||
void bar() {
|
||||
foo(<error descr="Multiple non-overriding abstract methods found">() ->{}</error>);
|
||||
foo(<error descr="Multiple non-overriding abstract methods found in interface NotAFIT.First.A">() ->{}</error>);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class NotAFIT {
|
||||
}
|
||||
|
||||
void bar() {
|
||||
foo(<error descr="Multiple non-overriding abstract methods found">()->{}</error>);
|
||||
foo(<error descr="Multiple non-overriding abstract methods found in interface NotAFIT.WithInheritance.B">()->{}</error>);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,3 +9,13 @@ class Test {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class Test1 {
|
||||
{
|
||||
Supplier<Runnable> x = foo(() -> <error descr="Multiple non-overriding abstract methods found in interface java.util.List">() -> null</error>);
|
||||
}
|
||||
|
||||
static <T> Supplier<T> foo(Supplier<java.util.List<T>> delegate) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user