-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Closed
Copy link
Labels
A-ReflectionRuntime information about typesRuntime information about typesC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
Milestone
Description
Bevy version and features
What you did
I tried the following code:
use bevy_reflect::{PartialReflect, Reflect};
#[derive(Reflect)]
enum A {
Foo,
Bar,
}
#[derive(Reflect)]
enum B {
Bar,
Foo,
}
fn main() {
dbg!(A::Foo.reflect_partial_cmp(&A::Bar)); // Some(Less)
dbg!(A::Bar.reflect_partial_cmp(&B::Foo)); // Some(Equal)
dbg!(A::Foo.reflect_partial_cmp(&B::Foo)); // Some(Equal)
dbg!(A::Bar.reflect_partial_cmp(&B::Foo)); // Some(Equal)
dbg!(A::Bar.reflect_partial_eq(&B::Foo)); // Some(false)
}What went wrong
In the first 3 checks we can notice that A::Foo < A::Bar = B::Foo. From this we should conclude that A::Foo < B::Foo, however we also get A::Foo = Bar::Foo.
In the last 2 checks we can notice that A::Bar = B::Foo when compared using reflect_partial_cmp, however A::Bar != B::Foo when compared using reflect_partial_eq
Metadata
Metadata
Assignees
Labels
A-ReflectionRuntime information about typesRuntime information about typesC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon