{"record":{"id":"5bf2b40dc4845d2b","repo":"bevyengine/bevy","slug":"attempted-to-apply-from-kind-to-to-kind","errorCode":null,"errorMessage":"attempted to apply `{from_kind}` to `{to_kind}`","messagePattern":"attempted to apply `(.+?)` to `(.+?)`","errorType":"exception","errorClass":"ApplyError","httpStatus":null,"severity":"error","filePath":"crates/bevy_reflect/src/reflect.rs","lineNumber":23,"sourceCode":"    ReflectOwned, ReflectRef, TypeInfo, TypePath, Typed,\n};\nuse alloc::borrow::Cow;\nuse alloc::boxed::Box;\nuse alloc::string::ToString;\nuse core::{\n    any::{Any, TypeId},\n    cmp::Ordering,\n    fmt::Debug,\n};\n\nuse thiserror::Error;\n\nuse crate::utility::NonGenericTypeInfoCell;\n\n/// A enumeration of all error outcomes that might happen when running [`try_apply`](PartialReflect::try_apply).\n#[derive(Error, Debug)]\npub enum ApplyError {\n    #[error(\"attempted to apply `{from_kind}` to `{to_kind}`\")]\n    /// Attempted to apply the wrong [kind](ReflectKind) to a type, e.g. a struct to an enum.\n    MismatchedKinds {\n        /// Kind of the value we attempted to apply.\n        from_kind: ReflectKind,\n        /// Kind of the type we attempted to apply the value to.\n        to_kind: ReflectKind,\n    },\n\n    #[error(\"enum variant `{variant_name}` doesn't have a field named `{field_name}`\")]\n    /// Enum variant that we tried to apply to was missing a field.\n    MissingEnumField {\n        /// Name of the enum variant.\n        variant_name: Box<str>,\n        /// Name of the missing field.\n        field_name: Box<str>,\n    },\n\n    #[error(\"`{from_type}` is not `{to_type}`\")]","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_reflect/src/reflect.rs#L5-L41","documentation":"ApplyError::MismatchedKinds — PartialReflect::try_apply was asked to apply a value of one ReflectKind (e.g. struct) onto a destination of another kind (e.g. enum), which is impossible. Payloads: from_kind and to_kind ReflectKinds. Apply values of matching kinds.","triggerScenarios":"Thrown at crates/bevy_reflect/src/reflect.rs:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Apply a value of the same reflected kind as the target","Convert the source to the target's kind before applying"],"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-14T00:17:10.932Z"}