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 {}
Unless stated otherwise, the documentation on this site reflects Dart 3.8.0. Page last updated on 2025-05-08. View source or report an issue.