Skip to content

Commit e51d5bf

Browse files
MichalGniadekmockersf
authored andcommitted
Register unit type alongside the other primitives (#21298)
# Objective Primitive types are automatically registered when a `TypeRegistry` is created, except for unit type `()`. ## Solution Register `()` alongside other primitives. ## Testing Run tests in `bevy_reflect`, tested with my code that `()` is being registered.
1 parent 4b62d47 commit e51d5bf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/bevy_reflect/src/type_registry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ impl TypeRegistry {
100100
/// Create a type registry with default registrations for primitive types.
101101
pub fn new() -> Self {
102102
let mut registry = Self::empty();
103+
registry.register::<()>();
103104
registry.register::<bool>();
104105
registry.register::<char>();
105106
registry.register::<u8>();

0 commit comments

Comments
 (0)