super_ in_ extension
Details about the 'super_in_extension' diagnostic produced by the Dart analyzer.
The 'super' keyword can't be used in an extension because an extension doesn't have a superclass.
Description
#
The analyzer produces this diagnostic when a member declared
inside an extension uses the super keyword .
Extensions aren't classes and don't have superclasses, so the
super keyword serves no purpose.
Example
#
The following code produces this diagnostic because
super can't be used in an extension:
extension E on Object {
String get displayString => super.toString();
}
Common fixes
#Remove the super keyword :
extension E on Object {
String get displayString => toString();
}
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.