bevyengine/bevy · error · FunctionError

no overload found for arguments with signature

Error message

no overload found for arguments with signature `{received:?}`, expected one of `{expected:?}`

What it means

FunctionError::OverloadMismatch — the arguments' type signature matched none of the function's registered overloads. Payloads: the received argument signature and the list of expected signatures; adjust argument types or register a matching overload.

Solutions

  1. Pass argument types matching one of the listed expected signatures
  2. Register an overload accepting the given signature
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/bevy_reflect/src/func/error.rs:28 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20). Data as JSON: /api/errors/86423ca0109d8806. Report an issue: GitHub.

Appendix: source

Thrown at crates/bevy_reflect/src/func/error.rs:28

/// An error that occurs when calling a [`DynamicFunction`] or [`DynamicFunctionMut`].
///
/// [`DynamicFunction`]: crate::func::DynamicFunction
/// [`DynamicFunctionMut`]: crate::func::DynamicFunctionMut
#[derive(Debug, Error, PartialEq)]
pub enum FunctionError {
    /// An error occurred while converting an argument.
    #[error(transparent)]
    ArgError(#[from] ArgError),
    /// The number of arguments provided does not match the expected number.
    #[error("received {received} arguments but expected one of {expected:?}")]
    ArgCountMismatch {
        /// Expected argument count. [`ArgCount`] for overloaded functions will contain multiple possible counts.
        expected: ArgCount,
        /// Number of arguments received.
        received: usize,
    },
    /// No overload was found for the given set of arguments.
    #[error("no overload found for arguments with signature `{received:?}`, expected one of `{expected:?}`")]
    NoOverload {
        /// The set of available argument signatures.
        expected: HashSet<ArgumentSignature>,
        /// The received argument signature.
        received: ArgumentSignature,
    },
}

/// The result of calling a [`DynamicFunction`] or [`DynamicFunctionMut`].
///
/// Returns `Ok(value)` if the function was called successfully,
/// where `value` is the [`Return`] value of the function.
///
/// [`DynamicFunction`]: crate::func::DynamicFunction
/// [`DynamicFunctionMut`]: crate::func::DynamicFunctionMut
pub type FunctionResult<'a> = Result<Return<'a>, FunctionError>;

/// An error that occurs when attempting to add a function overload.

View on GitHub (pinned to 396ca72708)