We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
UninhabitedType
1 parent a017ea5 commit 4f2e9b4Copy full SHA for 4f2e9b4
mypy/checker.py
@@ -5304,6 +5304,10 @@ def visit_match_stmt(self, s: MatchStmt) -> None:
5304
new_type_context = get_proper_type(pattern_type.rest_type)
5305
if isinstance(new_type_context, UninhabitedType):
5306
continue
5307
+ if isinstance(new_type_context, UnionType) and any(
5308
+ isinstance(get_proper_type(t), UninhabitedType) for t in new_type_context.items
5309
+ ):
5310
+ continue
5311
type_context = new_type_context
5312
5313
type_maps: list[TypeMap] = [t.captures for t in pattern_types]
0 commit comments