Skip to content

Commit 85d16bd

Browse files
committed
Add comment
1 parent 968a8bd commit 85d16bd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mypy/checker.py

+2
Original file line numberDiff line numberDiff line change
@@ -5452,6 +5452,8 @@ def visit_match_stmt(self, s: MatchStmt) -> None:
54525452
pattern_map, else_map = conditional_types_to_typemaps(
54535453
named_subject, pattern_type.type, pattern_type.rest_type
54545454
)
5455+
# Maybe the subject type can be inferred from constraints on
5456+
# its attribute/item?
54555457
if pattern_map and named_subject in pattern_map:
54565458
pattern_map[s.subject] = pattern_map[named_subject]
54575459
if else_map and named_subject in else_map:

0 commit comments

Comments
 (0)