extension_type_representation_type_bottom
The representation type can't be a bottom type.
Description
#The analyzer produces this diagnostic when the representation type of an extension type is the bottom type Never
. The type Never
can't be the representation type of an extension type because there are no values that can be extended.
Example
#The following code produces this diagnostic because the representation type of the extension type E
is Never
:
dart
extension type E(Never n) {}
Common fixes
#Replace the extension type with a different type:
dart
extension type E(String s) {}
Was this page's content helpful?
Thank you for your feedback!
Provide details Thank you for your feedback! Please let us know what we can do to improve.
Provide details Unless stated otherwise, the documentation on this site reflects Dart 3.8.1. Page last updated on 2025-05-08. View source or report an issue.