From f0c0c7770cc562976f2cb82366843de43feba477 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Jan 2026 21:55:13 +0000 Subject: [PATCH] Fix misleading comment about Bindings structure Update the doc comment to clarify that Bindings represents a union of callables (possibly size one), where each element is an intersection (possibly size one). This addresses review comment 5 from PR #22469. --- crates/ty_python_semantic/src/types/call/bind.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/ty_python_semantic/src/types/call/bind.rs b/crates/ty_python_semantic/src/types/call/bind.rs index 99ca59cb8f..aa016e9120 100644 --- a/crates/ty_python_semantic/src/types/call/bind.rs +++ b/crates/ty_python_semantic/src/types/call/bind.rs @@ -140,17 +140,17 @@ impl<'db> BindingsElement<'db> { } } -/// Binding information for a possible union or intersection of callables. +/// Binding information for a union of callables, where each union element may be an intersection. /// -/// For unions: At a call site, the arguments must be compatible with _all_ of the types +/// This structure represents a union (possibly size one) of callable elements, where each element +/// is an intersection (possibly size one) of callable bindings. +/// +/// For the union level: At a call site, the arguments must be compatible with _all_ elements /// in the union for the call to be valid. Return types are combined using union. /// -/// For intersections: At a call site, we try each element and discard elements where the -/// call fails. If at least one element succeeds, the call is valid. Return types are -/// combined using intersection. -/// -/// This structure supports nested unions of intersections. Each `BindingsElement` in `elements` -/// represents a union element, which could itself be an intersection of callables. +/// For the intersection level within each element: We try each binding and discard bindings +/// where the call fails. If at least one binding succeeds, the element succeeds. Return types +/// are combined using intersection. #[derive(Debug, Clone)] pub(crate) struct Bindings<'db> { /// The type that is (hopefully) callable.