bevyengine / bevyengine/bevy

Make `Typed`, `TypePath`, `GetTypeRegistration`, etc etc supertraits of `Reflect`

Open
#12,691 4 comments 0 reactions 0 assignees View on GitHub
A-Reflection C-Feature
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

Often just a `T: Reflect` bound is not sufficient. #5772 has a good example of why this is an issue.

## What solution would you like?

Have `Reflect` require all those traits, as it (almost?) never makes sense to implement `Reflect` without them. They are also all automatically derived when deriving `Reflect` (the only exception being `FromReflect`). #5772 claims this wasn't done because those traits are not object-safe, but this can be solved by just slapping some `where Self: Sized` on the offending methods.

## What alternative(s) have you considered?

- Keep the current status quo
- Combine those traits under a shared trait, but different than `Reflect`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.