Open
Description
Test:
class A {}
class B extends A {}
class Base {
void f(B arg) {}
}
abstract class Interface {
void f(covariant A arg);
}
class C extends Base implements Interface {}
Analyzer output:
Analyzing foo.dart...
error • Base class introduces an invalid override. The type of 'Base.f' ('(B) → void') isn't a subtype of 'Interface.f' ('(A) → void') at foo.dart:13:9 • strong_mode_invalid_method_override_from_base
1 error found.
The following similar test does not produce an error:
class A {}
class B extends A {}
class Base implements Interface {
void f(B arg) {}
}
abstract class Interface {
void f(covariant A arg);
}
class C extends Base {}
CFE doesn't flag any errors in both cases.
Metadata
Metadata
Assignees
Labels
For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.Contributions welcome to help resolve this (the resolution is expected to be clear from the issue)Issues with the analyzer's implementation of the language specIncorrect behavior (everything from a crash to more subtle misbehavior)