reportMatchNotExhaustive
false negative when variables used with *rest
#1004
Labels
type checking / linting
issues relating to existing diagnostic rules or proposals for new diagnostic rules
upstream bug
a bug that also exists in pyright but has not been raised upstream
The linter for the following code indicates that the match statement is not exhaustive and inferred return type is
str | None
:The
names
argument matches empty, one-element, two-element, and n + 2 elements, which exhaustes all the possible list constructions.by adding another arm to the match statement, the linter stops complaining:
The text was updated successfully, but these errors were encountered: