mixin_ application_ no_ concrete_ super_ invoked_ member
Details about the 'mixin_application_no_concrete_super_invoked_member' diagnostic produced by the Dart analyzer.
The class doesn't have a concrete implementation of the super-invoked member '{0}'.
The class doesn't have a concrete implementation of the super-invoked setter '{0}'.
Description
#The analyzer produces this diagnostic when a mixin applicationMixin applicationA class created when a mixin is applied to a class. Learn more contains an invocation of a member from its superclass, and there's no concrete member of that name in the mixin application's superclass.
Example
#
The following code produces this diagnostic because the mixin
M contains the invocation super.m(),
and the class A, which is the superclass of the
mixin applicationMixin applicationA class created when a mixin is applied to a class.
Learn more
A+M, doesn't define a concrete implementation of
m:
abstract class A {
void m();
}
mixin M on A {
void bar() {
super.m();
}
}
abstract class B extends A with M {}
Common fixes
#
If you intended to apply the mixin M to a
different class, one that has a concrete implementation of
m, then change the superclass of B
to that class:
abstract class A {
void m();
}
mixin M on A {
void bar() {
super.m();
}
}
class C implements A {
@override
void m() {}
}
abstract class B extends C with M {}
If you need to make B a subclass of
A, then add a concrete implementation of
m in A:
abstract class A {
void m() {}
}
mixin M on A {
void bar() {
super.m();
}
}
abstract class B extends A with M {}
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.