Skip to content

Commit 452f992

Browse files
authored
[ty] Simplify signature types, use them in CallableType (#18344)
There were many fields in `Signature` and friends that really had more to do with how a signature was being _used_ — how it was looked up, details about an individual call site, etc. Those fields more properly belong in `Bindings` and friends. This is a pure refactoring, and should not affect any tests or ecosystem projects. I started on this journey in support of astral-sh/ty#462. It seemed worth pulling out as a separate PR. One major concrete benefit of this refactoring is that we can now use `CallableSignature` directly in `CallableType`. (We can't use `CallableSignature` directly in that `Type` variant because signatures are not currently interned.)
1 parent a5ebb3f commit 452f992

File tree

8 files changed

+722
-681
lines changed

8 files changed

+722
-681
lines changed

crates/ty_python_semantic/src/types.rs

Lines changed: 289 additions & 401 deletions
Large diffs are not rendered by default.

crates/ty_python_semantic/src/types/call.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use super::context::InferContext;
2-
use super::{CallableSignature, Signature, Signatures, Type};
2+
use super::{Signature, Type};
33
use crate::Db;
44

55
mod arguments;
66
mod bind;
77
pub(super) use arguments::{Argument, CallArgumentTypes, CallArguments};
8-
pub(super) use bind::{Bindings, CallableBinding};
8+
pub(super) use bind::{Binding, Bindings, CallableBinding};
99

1010
/// Wraps a [`Bindings`] for an unsuccessful call with information about why the call was
1111
/// unsuccessful.

0 commit comments

Comments
 (0)