Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions crates/ty_python_semantic/resources/mdtest/narrow/match.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/astral-sh/ty/issues/4610>.

```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
Expand Down
Loading