concrete_class_has_enum_superinterface
Concrete classes can't have 'Enum' as a superinterface.
Description
#The analyzer produces this diagnostic when a concrete class indirectly has
the class Enum
as a superinterface.
Example
#The following code produces this diagnostic because the concrete class B
has Enum
as a superinterface as a result of implementing A
:
dart
abstract class A implements Enum {}
class B implements A {}
Common fixes
#If the implemented class isn't the class you intend to implement, then change it:
dart
abstract class A implements Enum {}
class B implements C {}
class C {}
If the implemented class can be changed to not implement Enum
, then do
so:
dart
abstract class A {}
class B implements A {}
If the implemented class can't be changed to not implement Enum
, then
remove it from the implements
clause:
dart
abstract class A implements Enum {}
class B {}
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。