subtype_ of_ base_ or_ final_ is_ not_ base_ final_ or_ sealed
Details about the 'subtype_of_base_or_final_is_not_base_final_or_sealed' diagnostic produced by the Dart analyzer.
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.12.2 版本报告页面问题.