Skip to content

Commit

Permalink
fix: modify current_type if not uninhabited
Browse files Browse the repository at this point in the history
  • Loading branch information
shenyih0ng committed Nov 7, 2024
1 parent 78fb78b commit 4cd8a8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mypy/checkpattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def visit_or_pattern(self, o: OrPattern) -> PatternType:
for pattern in o.patterns:
pattern_type = self.accept(pattern, current_type)
pattern_types.append(pattern_type)
current_type = pattern_type.rest_type
if not is_uninhabited(pattern_type.type):
current_type = pattern_type.rest_type

#
# Collect the final type
Expand Down

0 comments on commit 4cd8a8c

Please sign in to comment.