{"record":{"id":"588b8cd80d028deb","repo":"bevyengine/bevy","slug":"from-type-is-not-to-type","errorCode":null,"errorMessage":"`{from_type}` is not `{to_type}`","messagePattern":"`(.+?)` is not `(.+?)`","errorType":"exception","errorClass":"ApplyError","httpStatus":null,"severity":"error","filePath":"crates/bevy_reflect/src/reflect.rs","lineNumber":41,"sourceCode":"    #[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}`\")]\n    /// Tried to apply incompatible types.\n    MismatchedTypes {\n        /// Type of the value we attempted to apply.\n        from_type: Box<str>,\n        /// Type we attempted to apply the value to.\n        to_type: Box<str>,\n    },\n\n    #[error(\"attempted to apply type with {from_size} size to a type with {to_size} size\")]\n    /// Attempted to apply an [array-like] type to another of different size, e.g. a [u8; 4] to [u8; 3].\n    ///\n    /// [array-like]: crate::array::Array\n    DifferentSize {\n        /// Size of the value we attempted to apply, in elements.\n        from_size: usize,\n        /// Size of the type we attempted to apply the value to, in elements.\n        to_size: usize,\n    },","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_reflect/src/reflect.rs#L23-L59","documentation":"ApplyError::MismatchedTypes — try_apply found the source and destination TypeId/paths incompatible after kind checks (applying a value of from_type onto a destination of to_type). Apply a value of the same concrete type as the destination.","triggerScenarios":"Thrown at crates/bevy_reflect/src/reflect.rs:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Apply a value of the same type as the target","Convert the value before applying","Check reflect_type_path on both sides when debugging"],"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"}