Signature is incompatible with X |
|
When a method m overrides another definition of m in a super class, the return type must be identical.
class A extends Element {
A foo() {result=this }
}
class B extends A {
B foo() { result=this }
}
The example would be correct if the return type of B.foo were A.
|