[ty] Infer types for ty_extensions.Intersection[A, B] tuple expressions by sharkdp · Pull Request #18321 · astral-sh/ruff (original) (raw)

#[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
  |
");

}