implements_ super_ class
Details about the 'implements_super_class' diagnostic produced by the Dart analyzer.
'{0}' can't be used in both the 'extends' and 'implements' clauses.
'{0}' can't be used in both the 'extends' and 'with' clauses.
Description
#
The analyzer produces this diagnostic when a class is listed
in the
extends clause of a class declaration and also in
either the implements or with clause
of the same declaration.
Example
#
The following code produces this diagnostic because the class
A is used in both the extends and
implements clauses for the class B:
// @dart = 3.5
class A {}
class B extends A implements A {}
The following code produces this diagnostic because the class
A is used in both the extends and
with clauses for the class B:
mixin class A {}
class B extends A with A {}
Common fixes
#
If you want to inherit the implementation from the class, then
remove the class from the implements clause:
class A {}
class B extends A {}
If you don't want to inherit the implementation from the
class, then remove the extends clause:
class A {}
class B implements A {}
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.