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).
Markdown files within the mdtest/ subdirectory are tests of type inference and type checking;
executed by the tests/mdtest.rs integration test.
See crates/ty_test/README.md for documentation of this test format.