pub enum CallResult {
Success(TypeId),
NotCallable {
type_id: TypeId,
},
ThisTypeMismatch {
expected_this: TypeId,
actual_this: TypeId,
},
ArgumentCountMismatch {
expected_min: usize,
expected_max: Option<usize>,
actual: usize,
},
OverloadArgumentCountMismatch {
actual: usize,
expected_low: usize,
expected_high: usize,
},
ArgumentTypeMismatch {
index: usize,
expected: TypeId,
actual: TypeId,
},
NonVoidFunctionCalledWithNew,
TypeParameterConstraintViolation {
inferred_type: TypeId,
constraint_type: TypeId,
return_type: TypeId,
},
NoOverloadMatch {
func_type: TypeId,
arg_types: Vec<TypeId>,
failures: Vec<PendingDiagnostic>,
fallback_return: TypeId,
},
}Expand description
Result of attempting to call a function type.
Variants§
Success(TypeId)
Call succeeded, returns the result type
NotCallable
Not a callable type
ThisTypeMismatch
this type mismatch
ArgumentCountMismatch
Argument count mismatch
OverloadArgumentCountMismatch
Overloaded call with arity “gap”: no overload matches this exact arity, but overloads exist for two surrounding fixed arities (TS2575).
ArgumentTypeMismatch
Argument type mismatch at specific position
NonVoidFunctionCalledWithNew
TS2350: Only a void function can be called with the ‘new’ keyword.
TypeParameterConstraintViolation
Type parameter constraint violation (TS2322, not TS2345). Used when inference from callback return types produces a type that violates the type parameter’s constraint. tsc reports TS2322 on the return expression, not TS2345 on the whole callback argument.
Fields
NoOverloadMatch
No overload matched (for overloaded functions)
Trait Implementations§
Source§impl Clone for CallResult
impl Clone for CallResult
Source§fn clone(&self) -> CallResult
fn clone(&self) -> CallResult
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 moreAuto Trait Implementations§
impl Freeze for CallResult
impl RefUnwindSafe for CallResult
impl Send for CallResult
impl Sync for CallResult
impl Unpin for CallResult
impl UnsafeUnpin for CallResult
impl UnwindSafe for CallResult
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