Open
Description
See this example from @yanok (dartpad):
abstract class A {
@override
bool operator ==(dynamic other);
}
class B implements A {}
void test(dynamic x, dynamic y, dynamic z) {
print(x == y || x == z);
}
void main() {
var b1 = B(), b2 = B();
B? b3;
print(b1 == null);
print(b1 == b2);
print(b3 == b2);
print(b3 == null);
test(b1, b2, b3);
}
This program runs without error, but analyzer reports an invalid_implementation_override
error at line 6 (class B implements A {}
):
'Object.==' ('bool Function(Object)') isn't a valid concrete implementation of 'A.==' ('bool Function(dynamic)').
There is either a bug in analyzer or CFE.
cc @scheglov