Incorrect unreachable case warning with nullable matched value type and list pattern #55543
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
area-front-end
Use area-front-end for front end / CFE / kernel format related issues.
cfe-dysfunctionalities
Issues for the CFE not behaving as intended
P2
A bug or feature request we're likely to work on
soundness
If I analyze:
I get:
It apparently thinks that the preceding case's list pattern covers... everything? This is doubly wrong: The first case won't match
null
, nor will it match non-null lists of any length other than one.It seems to have something to do with the matched value type being nullable. If I change it to:
Then there are no warnings.
The text was updated successfully, but these errors were encountered: