subtype_of_base_or_final_is_not_base_final_or_sealed
The mixin '{0}' must be 'base' because the supertype '{1}' is 'base'.
The mixin '{0}' must be 'base' because the supertype '{1}' is 'final'.
The type '{0}' must be 'base', 'final' or 'sealed' because the supertype '{1}' is 'base'.
The type '{0}' must be 'base', 'final' or 'sealed' because the supertype '{1}' is 'final'.
Description
#The analyzer produces this diagnostic when a class or mixin has a direct
or indirect supertype that is either base
or final
, but the class or
mixin itself isn't marked either base
, final
, or sealed
.
Example
#The following code produces this diagnostic because the class B
is a
subtype of A
, and A
is a base
class, but B
is neither base
,
final
or sealed
:
base class A {}
class B extends A {}
Common fixes
#Add either base
, final
or sealed
to the class or mixin declaration:
base class A {}
final class B extends A {}
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。