mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-28 23:50:57 +07:00
Also: report every incompatible parameter, not only the first one Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only) GitOrigin-RevId: a9d75a78207d0910f0bcbb6060e38acedc3f07d3
37 lines
935 B
Java
37 lines
935 B
Java
interface I {
|
|
void m(int i);
|
|
}
|
|
|
|
class Foo {
|
|
I ii = (<error descr="'@Override' not applicable to parameter">@Override</error> final int k) -> {
|
|
int j = k;
|
|
};
|
|
I ii1 = (final int k) -> {
|
|
String s = <error descr="Incompatible types. Found: 'int', required: 'java.lang.String'">k</error>;
|
|
};
|
|
|
|
void bazz() {
|
|
bar((<error descr="Incompatible parameter type in lambda expression: expected int but found String">String s</error>) -> {
|
|
System.out.println(s);});
|
|
bar((int i) -> {System.out.println(i);});
|
|
}
|
|
|
|
void bar(I i) { }
|
|
}
|
|
|
|
class ReturnTypeCompatibility {
|
|
interface I1<L> {
|
|
L m(L x);
|
|
}
|
|
|
|
static <P> void call(I1<P> i2) {
|
|
i2.m(null);
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
call((String i)->{ return i;});
|
|
call(i->{ return i;});
|
|
call(i->"");
|
|
call(<error descr="no instance(s) of type variable(s) P exist so that P conforms to int">(int i)->{ return i;}</error>);
|
|
}
|
|
} |