Make #[derive(Bundle)] work on tuple structs #2499
Make #[derive(Bundle)] work on tuple structs #2499Veykril wants to merge 5 commits intobevyengine:mainfrom
#[derive(Bundle)] work on tuple structs #2499Conversation
alice-i-cecile
left a comment
There was a problem hiding this comment.
I like this! Nice bit of consistency. Could you add a quick test or doc test to statically verify that #[derive(Bundle)] works on the various struct types so we don't break it by accident in the future?
Otherwise LGTM.
|
Do we really want to allow unit types be bundles? This would almost certainly be a user error to do that |
|
Prior to this PR empty records are already allowed which would also be user errors to derive Bundle on. I suppose it would make sense to emit a compile error for structs with no fields in general? |
I agree with this. If we find some obscure use case where this makes sense we can add this functionality back in :) |
|
Sorry for leaving this in limbo for far too long :( |
|
No worries, I am just not interested in updating the PR any longer. And truthfully spoken, given the huge backlog of PRs on the project I wouldn't expect it to get merged until its outdated again. If someone wants to update it be my guest though 👍 |
- rework of old @Veykril's work in [2499](bevyengine#2499) - Fixes [3537](bevyengine#3537)
Objective
Bundletrait on all kinds of structs that is Record, Tuple and Unit(not that useful by itself, but for completioness sake) structs instead of just record structs.