The following program produces the wrong error message:
interface A {
}
class Test {
A foo() {
return this;
}
}
The error is:
T.java:6: Incompatible type for return. Can't convert Test to A.
return this;
^
It should be:
T.java:6: Incompatible type for return. Explicit cast needed to convert Test to A.
return this;
^