{"record":{"id":"d152680036df95a2","repo":"bevyengine/bevy","slug":"expected-expected-value-but-received-received","errorCode":null,"errorMessage":"expected {expected} value but received {received} value (@ argument index {index})","messagePattern":"expected (.+?) value but received (.+?) value \\(@ argument index (.+?)\\)","errorType":"exception","errorClass":"ArgError","httpStatus":null,"severity":"error","filePath":"crates/bevy_reflect/src/func/args/error.rs","lineNumber":23,"sourceCode":"use 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    },\n    /// Occurs when attempting to access an argument from an empty [`ArgList`].\n    ///\n    /// [`ArgList`]: crate::func::args::ArgList\n    #[error(\"expected an argument but received none\")]\n    EmptyArgList,\n}\n\n/// The given argument count is out of bounds.\n#[derive(Debug, Error, PartialEq)]\n#[error(\"argument count out of bounds: {0}\")]","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_reflect/src/func/args/error.rs#L5-L41","documentation":"ArgError::InvalidOwnership — the argument was provided with the wrong ownership (Owned/Ref/Mut) for the parameter, e.g. passing a shared ref where an owned value is consumed. Payloads: argument index, expected and received Ownership.","triggerScenarios":"Thrown at crates/bevy_reflect/src/func/args/error.rs:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the value with the ownership the signature expects (owned vs reference vs mutable reference)","Adjust the function signature to accept the provided ownership"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}