annotate_ redeclares
Details about the 'annotate_redeclares' diagnostic produced by the Dart analyzer.
The member '{0}' is redeclaring but isn't annotated with '@redeclare'.
Description
#
The analyzer produces this diagnostic when an extension type member redeclares
a member from an implemented interface without the @redeclare annotation.
Example
#
The following code produces this diagnostic because the f method in the
extension type E redeclares the f method from C without the
@redeclare annotation:
class C {
void f() { }
}
extension type E(C c) implements C {
void f() { }
}
Common fixes
#Add the @redeclare annotation to make the redeclaration explicit:
import 'package:meta/meta.dart';
class C {
void f() { }
}
extension type E(C c) implements C {
@redeclare
void f() { }
}
Unless stated otherwise, the documentation on this site reflects Dart 3.11.0. Report an issue.