pub struct CallableShape {
pub call_signatures: Vec<CallSignature>,
pub construct_signatures: Vec<CallSignature>,
pub properties: Vec<PropertyInfo>,
pub string_index: Option<IndexSignature>,
pub number_index: Option<IndexSignature>,
pub symbol: Option<SymbolId>,
}Expand description
Callable type with multiple overloaded call signatures Represents types like:
interface Overloaded {
(x: string): number;
(x: number): string;
}NOTE: The symbol field affects BOTH Hash and PartialEq for nominal discrimination.
This ensures that different classes get different TypeIds in the interner.
Structural subtyping is computed explicitly in the Solver, not via PartialEq.
Fields§
§call_signatures: Vec<CallSignature>Call signatures (order matters for overload resolution)
construct_signatures: Vec<CallSignature>Constructor signatures
properties: Vec<PropertyInfo>Optional properties on the callable (e.g., Function.prototype)
string_index: Option<IndexSignature>String index signature (for static index signatures on classes)
number_index: Option<IndexSignature>Number index signature (for static index signatures on classes)
symbol: Option<SymbolId>Nominal identity for class constructors (prevents structural interning of distinct classes)
Trait Implementations§
Source§impl Clone for CallableShape
impl Clone for CallableShape
Source§fn clone(&self) -> CallableShape
fn clone(&self) -> CallableShape
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CallableShape
impl Debug for CallableShape
Source§impl Default for CallableShape
impl Default for CallableShape
Source§fn default() -> CallableShape
fn default() -> CallableShape
Returns the “default value” for a type. Read more
Source§impl Hash for CallableShape
impl Hash for CallableShape
Source§impl PartialEq for CallableShape
impl PartialEq for CallableShape
impl Eq for CallableShape
Auto Trait Implementations§
impl Freeze for CallableShape
impl RefUnwindSafe for CallableShape
impl Send for CallableShape
impl Sync for CallableShape
impl Unpin for CallableShape
impl UnsafeUnpin for CallableShape
impl UnwindSafe for CallableShape
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.