Closed
Description
Consider the following code:
class A {}
class B extends A {}
class C {
void f(B x, B y) {}
}
abstract class I1 {
void f(covariant A x, B y);
}
class D extends C implements I1 {}
As pointed out in #31580 (comment), the class D
should be rejected at compile time because its implementation of f
has type void Function(B, B)
, which is not a valid override type for the member type of f
in the interface of D
, void Function(covariant A, B)
.
I have not yet implemented the override checking rules in the front end (I will soon). This bug serves as a reminder that the case above should result in an error.