ruff/crates/ty_python_semantic/resources/mdtest/conditional
David Peter 739c94f95a
[ty] Support as-patterns in reachability analysis (#19728)
## Summary

Support `as` patterns in reachability analysis:

```py
from typing import assert_never


def f(subject: str | int):
    match subject:
        case int() as x:
            pass
        case str():
            pass
        case _:
            assert_never(subject)  # would previously emit an error
```

Note that we still don't support inferring correct types for the bound
name (`x`).

Closes https://github.com/astral-sh/ty/issues/928

## Test Plan

New Markdown tests
2025-08-04 20:13:50 +02:00
..
if_expression.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
if_statement.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
match.md [ty] Support as-patterns in reachability analysis (#19728) 2025-08-04 20:13:50 +02:00