{"record":{"id":"3db0f5f2556be45b","repo":"bevyengine/bevy","slug":"underlying-type-does-not-reflect-partialeq-and-h-3db0f5","errorCode":null,"errorMessage":"Underlying type does not reflect `PartialEq` and hence doesn't support equality checks","messagePattern":"Underlying type does not reflect `PartialEq` and hence doesn't support equality checks","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_reflect/src/set.rs","lineNumber":195,"sourceCode":"        self.represented_type = represented_type;\n    }\n\n    /// Inserts a typed value into the set.\n    pub fn insert<V: Reflect>(&mut self, value: V) {\n        self.insert_boxed(Box::new(value));\n    }\n\n    fn internal_hash(value: &dyn PartialReflect) -> u64 {\n        value.reflect_hash().expect(&hash_error!(value))\n    }\n\n    fn internal_eq(\n        value: &dyn PartialReflect,\n    ) -> impl FnMut(&Box<dyn PartialReflect>) -> bool + '_ {\n        |other| {\n            value\n                .reflect_partial_eq(&**other)\n                .expect(\"Underlying type does not reflect `PartialEq` and hence doesn't support equality checks\")\n        }\n    }\n}\n\nimpl Set for DynamicSet {\n    fn get(&self, value: &dyn PartialReflect) -> Option<&dyn PartialReflect> {\n        self.hash_table\n            .find(Self::internal_hash(value), Self::internal_eq(value))\n            .map(|value| &**value)\n    }\n\n    fn len(&self) -> usize {\n        self.hash_table.len()\n    }\n\n    fn iter(&self) -> Box<dyn Iterator<Item = &dyn PartialReflect> + '_> {\n        let iter = self.hash_table.iter().map(|v| &**v);\n        Box::new(iter)","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/bevyengine/bevy/blob/8d743eb7dc7fcff57a7d5744d0bbf89620b1b145/crates/bevy_reflect/src/set.rs#L177-L213","documentation":"Panic in DynamicSet's internal_eq: equality comparison was attempted on values whose underlying type does not implement reflected PartialEq, so the result of reflect_partial_eq is an error rather than a bool.","triggerScenarios":"Thrown at crates/bevy_reflect/src/set.rs:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add #[reflect(PartialEq)] to the element types stored in the set","Avoid inserting non-PartialEq types into reflected sets"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8d743eb7dc7fcff57a7d5744d0bbf89620b1b145","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}