Skip to content

Commit ef97631

Browse files
committed
Add test for remote reflecting an actual external type
1 parent 39f9b00 commit ef97631

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

crates/bevy_reflect/src/lib.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,6 +2749,26 @@ bevy_reflect::tests::Test {
27492749
);
27502750
}
27512751

2752+
#[test]
2753+
fn should_reflect_external_crate_type() {
2754+
// This test relies on the external type not implementing `Reflect`,
2755+
// so let's just double-check that it does not
2756+
assert_not_impl_all!(std::collections::Bound<i32>: Reflect);
2757+
2758+
#[reflect_remote(std::collections::Bound<T>)]
2759+
enum MyBound<T> {
2760+
Included(T),
2761+
Excluded(T),
2762+
Unbounded,
2763+
}
2764+
2765+
#[derive(Reflect)]
2766+
struct MyType {
2767+
#[reflect(remote = MyBound<String>)]
2768+
bound: std::collections::Bound<String>,
2769+
}
2770+
}
2771+
27522772
#[cfg(feature = "glam")]
27532773
mod glam {
27542774
use super::*;

0 commit comments

Comments
 (0)