super_ in_ extension_ type
Details about the 'super_in_extension_type' diagnostic produced by the Dart analyzer.
The 'super' keyword can't be used in an extension type because an extension type doesn't have a superclass.
Description
#
The analyzer produces this diagnostic when super is used in an instance
member of an extension type. Extension types don't have superclasses, so
there's no inherited member that could be invoked.
Example
#The following code produces this diagnostic because :
extension type E(String s) {
void m() {
super.m();
}
}
Common fixes
#Replace or remove the super invocation:
extension type E(String s) {
void m() {
s.toLowerCase();
}
}
Unless stated otherwise, the documentation on this site reflects Dart 3.10.3. Report an issue.