diff --git a/crates/ty_python_semantic/resources/mdtest/narrow/match.md b/crates/ty_python_semantic/resources/mdtest/narrow/match.md index 5f4189e0bf849..54fc78736a8e1 100644 --- a/crates/ty_python_semantic/resources/mdtest/narrow/match.md +++ b/crates/ty_python_semantic/resources/mdtest/narrow/match.md @@ -3644,6 +3644,20 @@ def guard_with_changing_flag(value: int | str, again: bool) -> None: flag = True ``` +## Match subject refers to a later capture + +Regression test for . + +```py +subject = [1] +for _ in [0]: + match [x for x in subject]: + case subject.attr: # error: [unresolved-attribute] + pass + case b"" as subject: + pass +``` + ## Value patterns Value patterns are evaluated by equality, which is overridable. Apart from the optimistic treatment