Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/inference/FunctionalInterfaceShouldHaveExactlyOneMethod.java
Tagir Valeev 5b5abb8e13 [java-highlighting] Lambda-related type errors migrated
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 1fb0b4c35b4db63d8c15cb392098380d1014ebf2
2025-02-04 09:52:02 +00:00

48 lines
861 B
Java

public class NotAFIT {
static class First {
static interface A<T> {
void foo1();
void foo2();
}
static <T> void foo(A<T> a) {
}
void bar() {
foo(<error descr="Multiple non-overriding abstract methods found in A">() ->{}</error>);
}
}
static class WithInheritance {
static interface A<T> {
void foo1();
}
static interface B<M> extends A<M> {
void foo2();
}
static <T> void foo(B<T> a) {
}
void bar() {
foo(<error descr="Multiple non-overriding abstract methods found in B">()->{}</error>);
}
}
static class WithInheritanceOverrideSameMethod {
static interface A<T> {
void foo1();
}
static interface B<M> extends A<M> {
void foo1();
}
static <T> void foo(B<T> a) {
}
void bar() {
foo(()->{});
}
}
}