{"record":{"id":"b13fe675ee305c22","repo":"bevyengine/bevy","slug":"expected-expected-but-received-received","errorCode":null,"errorMessage":"expected `{expected}` but received `{received}` (@ argument index {index})","messagePattern":"expected `(.+?)` but received `(.+?)` \\(@ argument index (.+?)\\)","errorType":"exception","errorClass":"ArgError","httpStatus":null,"severity":"error","filePath":"crates/bevy_reflect/src/func/args/error.rs","lineNumber":13,"sourceCode":"use alloc::borrow::Cow;\n\nuse thiserror::Error;\n\nuse crate::func::args::Ownership;\n\n/// An error that occurs when converting an [argument].\n///\n/// [argument]: crate::func::args::Arg\n#[derive(Debug, Error, PartialEq)]\npub enum ArgError {\n    /// The argument is not the expected type.\n    #[error(\"expected `{expected}` but received `{received}` (@ argument index {index})\")]\n    UnexpectedType {\n        /// Argument index.\n        index: usize,\n        /// Expected argument type path.\n        expected: Cow<'static, str>,\n        /// Received argument type path.\n        received: Cow<'static, str>,\n    },\n    /// The argument has the wrong ownership.\n    #[error(\"expected {expected} value but received {received} value (@ argument index {index})\")]\n    InvalidOwnership {\n        /// Argument index.\n        index: usize,\n        /// Expected ownership.\n        expected: Ownership,\n        /// Received ownership.\n        received: Ownership,\n    },","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_reflect/src/func/args/error.rs#L1-L31","documentation":"ArgError::UnexpectedType — while converting a reflected argument for a dynamic function call, the argument's type did not match the parameter's expected type. The payload carries the argument index plus the expected and received type paths.","triggerScenarios":"Thrown at crates/bevy_reflect/src/func/args/error.rs:13 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an argument of the expected type at the failing index","Fix the function's argument signature to match what callers send","Convert the argument before calling"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}