Example:
extension type B<T>(T? _) {}
extension type N(Null _) implements B<Never> {}
which yields the info:
Analyzing badwarn.dart...
info - badwarn.dart:2:18 - Unnecessary use of the type 'Null'.
Try using 'void' instead. - prefer_void_to_null
1 issue found.
Since changing Null to void would be a compile-time error, extension type representation types might not be the best place to apply that info.
(Any time a type has to be a subtype of some other type, suggesting void instead of Null risks being invalid.)
Example:
which yields the info:
Since changing
Nulltovoidwould be a compile-time error, extension type representation types might not be the best place to apply that info.(Any time a type has to be a subtype of some other type, suggesting
voidinstead ofNullrisks being invalid.)