We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 968a8bd commit 85d16bdCopy full SHA for 85d16bd
mypy/checker.py
@@ -5452,6 +5452,8 @@ def visit_match_stmt(self, s: MatchStmt) -> None:
5452
pattern_map, else_map = conditional_types_to_typemaps(
5453
named_subject, pattern_type.type, pattern_type.rest_type
5454
)
5455
+ # Maybe the subject type can be inferred from constraints on
5456
+ # its attribute/item?
5457
if pattern_map and named_subject in pattern_map:
5458
pattern_map[s.subject] = pattern_map[named_subject]
5459
if else_map and named_subject in else_map:
0 commit comments