False positive with prefer_void_to_null
#59179
Labels
analyzer-linter
Issues with the analyzer's support for the linter package
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
linter-false-positive
linter-set-recommended
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Consider the following program:
This program causes the lint
prefer_void_to_null
to flag the use of the typeNull
, and it is suggested that it should be replaced byvoid
.This is a false positive:
List<(void, int)>
is not a subtype ofList<(int?, int?)>
and hence the suggested change would turn the program into a compile-time error.The expected behavior would be that this occurrence of
Null
is not linted.The text was updated successfully, but these errors were encountered: