diff --git a/crates/ty_python_semantic/src/types/class.rs b/crates/ty_python_semantic/src/types/class.rs index eff270aeb2..e681b21c8a 100644 --- a/crates/ty_python_semantic/src/types/class.rs +++ b/crates/ty_python_semantic/src/types/class.rs @@ -1044,7 +1044,11 @@ impl<'db> ClassType<'db> { .place; if let Place::Type(Type::FunctionLiteral(new_function), _) = new_function_symbol { - new_function.into_bound_method_type(db, self_ty) + Type::Callable( + new_function + .into_bound_method_type(db, self_ty) + .into_callable_type(db), + ) } else { // Fallback if no `object.__new__` is found. CallableType::single( diff --git a/crates/ty_python_semantic/src/types/function.rs b/crates/ty_python_semantic/src/types/function.rs index 9feaadb9a4..9447d9991f 100644 --- a/crates/ty_python_semantic/src/types/function.rs +++ b/crates/ty_python_semantic/src/types/function.rs @@ -800,13 +800,13 @@ impl<'db> FunctionType<'db> { CallableType::new(db, self.signature(db), false) } - /// Convert the `FunctionType` into a [`Type::BoundMethod`]. + /// Convert the `FunctionType` into a [`BoundMethodType`]. pub(crate) fn into_bound_method_type( self, db: &'db dyn Db, self_instance: Type<'db>, - ) -> Type<'db> { - Type::BoundMethod(BoundMethodType::new(db, self, self_instance)) + ) -> BoundMethodType<'db> { + BoundMethodType::new(db, self, self_instance) } pub(crate) fn has_relation_to(