undefined_ super_ operator
Details about the 'undefined_super_operator' diagnostic produced by the Dart analyzer.
The operator '{0}' isn't defined in a superclass of '{1}'.
Description
#
The analyzer produces this diagnostic when an operator is invoked on
super, but no superclass of the enclosing declaration defines that
operator.
Example
#
The following code produces this diagnostic because the superclass A
doesn't define the operator +:
class A {}
class B extends A {
int m() => super + 0;
}
Common fixes
#If the operator isn't defined, then add it to a superclass:
class A {
int operator +(int other) => 0;
}
class B extends A {
int m() => super + 0;
}
Otherwise, remove the invocation.
Unless stated otherwise, the documentation on this site reflects Dart 3.13.3. Report an issue.