Files
ruff/crates/ty_python_semantic
Claude bc4798f2ee [ty] Support unions containing intersection elements in call bindings
Refactors the `Bindings` structure to use a two-level representation:
- Outer level: union elements (each can be a single callable or an intersection)
- Inner level: bindings within an intersection element

This enables proper handling of types like `(A & B) | C` when calling,
where `A & B` is an intersection that was narrowed by `callable()`.

Key changes:
- Add `BindingsElement` struct to represent a single union element
  (which may contain multiple bindings for intersections)
- Update `from_union` to preserve intersection structure instead of
  flattening
- Update `from_intersection` to create a single element with multiple
  bindings
- Update `return_type`, `check_types_impl`, and `report_diagnostics`
  to handle the two-level structure
- Add test for union-of-intersections case

The priority hierarchy for intersection call errors is preserved: when
all bindings in an intersection fail, only the highest-priority error
type is reported (BindingError > TopCallable > NotCallable).
2026-01-09 06:35:57 +00:00
..
2026-01-02 19:58:15 +00:00