ruff/crates/red_knot_python_semantic/src
Douglas Creager 23ccb52fa6
[red-knot] Handle unions of callables better (#16716)
This cleans up how we handle calling unions of types. #16568 adding a
three-level structure for callable signatures (`Signatures`,
`CallableSignature`, and `Signature`) to handle unions and overloads.

This PR updates the bindings side to mimic that structure. What used to
be called `CallOutcome` is now `Bindings`, and represents the result of
binding actual arguments against a possible union of callables.
`CallableBinding` is the result of binding a single, possibly
overloaded, callable type. `Binding` is the result of binding a single
overload.

While we're here, this also cleans up `CallError` greatly. It was
previously extracting error information from the bindings and storing it
in the error result. It is now a simple enum, carrying no data, that's
used as a status code to talk about whether the overall binding was
successful or not. We are now more consistent about walking the binding
itself to get detailed information about _how_ the binding was
unsucessful.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Carl Meyer <carl@astral.sh>
2025-03-17 10:35:52 -04:00
..
module_resolver [internal]: Upgrade salsa (#16794) 2025-03-17 11:05:54 +01:00
semantic_index [internal]: Upgrade salsa (#16794) 2025-03-17 11:05:54 +01:00
types [red-knot] Handle unions of callables better (#16716) 2025-03-17 10:35:52 -04:00
util [red-knot] Improve ergonomics for the `PySlice` trait (#13983) 2024-10-29 20:40:59 +00:00
ast_node_ref.rs [red-knot] Support unpacking `with` target (#16469) 2025-03-08 02:36:35 +00:00
db.rs Add `OsSystem` support to mdtests (#16518) 2025-03-06 10:41:40 +01:00
lib.rs [red-knot] Don't use separate ID types for each alist (#16415) 2025-02-28 14:55:55 -05:00
lint.rs Add knot.toml schema (#15735) 2025-02-07 10:59:40 +01:00
list.rs [red-knot] Don't use separate ID types for each alist (#16415) 2025-02-28 14:55:55 -05:00
module_name.rs Bind top-most parent when importing nested module (#14946) 2024-12-16 16:15:40 -05:00
node_key.rs [red-knot] Use memory address as AST node key (#14317) 2024-11-13 14:35:54 +01:00
program.rs Rename `venv-path` to `python` (#16347) 2025-02-24 19:41:06 +01:00
python_platform.rs Add knot.toml schema (#15735) 2025-02-07 10:59:40 +01:00
semantic_index.rs [internal]: Upgrade salsa (#16794) 2025-03-17 11:05:54 +01:00
semantic_model.rs [red-knot] Rename *_ty functions (#15617) 2025-01-22 09:06:56 +01:00
site_packages.rs Add `OsSystem` support to mdtests (#16518) 2025-03-06 10:41:40 +01:00
suppression.rs ruff_db: add "secondary" messages to `Diagnostic` trait 2025-02-19 08:24:19 -05:00
symbol.rs [red-knot] Handle unions of callables better (#16716) 2025-03-17 10:35:52 -04:00
types.rs [red-knot] Handle unions of callables better (#16716) 2025-03-17 10:35:52 -04:00
unpack.rs [internal]: Upgrade salsa (#16794) 2025-03-17 11:05:54 +01:00