mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-13 23:07:01 +07:00
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only) GitOrigin-RevId: ed0cf0daf5dbfb034882d49ad5e9c03f264b451e
45 lines
1.1 KiB
Java
45 lines
1.1 KiB
Java
class Test {
|
|
interface I {
|
|
default void f() {}
|
|
}
|
|
|
|
interface J {
|
|
static void f() {}
|
|
}
|
|
|
|
static class IJ implements I, J {}
|
|
static class JI implements J, I {}
|
|
|
|
public static void main(String[] args) {
|
|
new IJ(). f();
|
|
new JI(). f();
|
|
|
|
IJ.<error descr="Non-static method 'f()' cannot be referenced from a static context">f</error>();
|
|
JI.<error descr="Non-static method 'f()' cannot be referenced from a static context">f</error>();
|
|
|
|
J.f();
|
|
}
|
|
}
|
|
|
|
class Test2 {
|
|
interface I {
|
|
static void f(String <warning descr="Parameter 's' is never used">s</warning>) {}
|
|
}
|
|
|
|
interface J<T> {
|
|
default void f(T <warning descr="Parameter 't' is never used">t</warning>) {}
|
|
|
|
//another pair
|
|
default void j(T <warning descr="Parameter 't' is never used">t</warning>) {}
|
|
static void j(String <warning descr="Parameter 's' is never used">s</warning>) {};
|
|
}
|
|
|
|
static class IJ implements I, J<String> {}
|
|
|
|
public static void main(IJ s, J<String> j) {
|
|
s.f("");
|
|
|
|
j.<error descr="Static method may only be called on its containing interface">j</error>("");
|
|
}
|
|
|
|
} |