super_in_enum_constructor
The enum constructor can't have a 'super' initializer.
Description
#The analyzer produces this diagnostic when the initializer list in a constructor in an enum contains an invocation of a super constructor.
Example
#The following code produces this diagnostic because the constructor in
the enum E
has a super constructor invocation in the initializer list:
dart
enum E {
e;
const E() : super();
}
Common fixes
#Remove the super constructor invocation:
dart
enum E {
e;
const E();
}
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。