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() {}
}
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.