mixin_application_no_concrete_super_invoked_member
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 application 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 application 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 {
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.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。