ruff/crates/ty_python_semantic
David Peter 4e68dd96a6
[ty] Infer types for ty_extensions.Intersection[A, B] tuple expressions (#18321)
## Summary

fixes astral-sh/ty#366

## Test Plan

* Added panic corpus regression tests
* I also wrote a hover regression test (see below), but decided not to
include it. The corpus tests are much more "effective" at finding these
types of errors, since they exhaustively check all expressions for
types.

<details>

```rs
#[test]
fn hover_regression_test_366() {
    let test = cursor_test(
        r#"
    from ty_extensions import Intersection

    class A: ...
    class B: ...

    def _(x: Intersection[A,<CURSOR> B]):
        pass
    "#,
    );

    assert_snapshot!(test.hover(), @r"
    A & B
    ---------------------------------------------
    ```text
    A & B
    ```
    ---------------------------------------------
    info[hover]: Hovered content is
     --> main.py:7:31
      |
    5 |         class B: ...
    6 |
    7 |         def _(x: Intersection[A, B]):
      |                               ^^-^
      |                               | |
      |                               | Cursor offset
      |                               source
    8 |             pass
      |
    ");
}
```

</details>
2025-05-26 17:08:52 +02:00
..
resources [ty] use __getattribute__ to lookup unknown members on a type (#18280) 2025-05-26 12:59:45 +02:00
src [ty] Infer types for ty_extensions.Intersection[A, B] tuple expressions (#18321) 2025-05-26 17:08:52 +02:00
tests Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
build.rs Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
Cargo.toml Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
mdtest.py Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
mdtest.py.lock Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00