Skip to content

bevy_reflect: Capture generic type info on opaque types#24382

Merged
mockersf merged 1 commit into
bevyengine:mainfrom
MrGVSV:mrgvsv/opaque-generic-info
May 22, 2026
Merged

bevy_reflect: Capture generic type info on opaque types#24382
mockersf merged 1 commit into
bevyengine:mainfrom
MrGVSV:mrgvsv/opaque-generic-info

Conversation

@MrGVSV
Copy link
Copy Markdown
Member

@MrGVSV MrGVSV commented May 21, 2026

Objective

Resolves #24235

Solution

This PR makes it so that opaque types (i.e. those marked with #[reflect(opaque)] or implemented with impl_reflect_opaque!), such as Arc<T>, capture generic type information when possible.

Upon reviewing the code, I don't believe this was an intentional limitation. And instead, it was probably just forgotten about.

Testing

I added new unit tests to ensure this works properly.

@MrGVSV MrGVSV added C-Bug An unexpected or incorrect behavior A-Reflection Runtime information about types S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 21, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Reflection May 21, 2026
@MrGVSV MrGVSV moved this from Needs SME Triage to SME Triaged in Reflection May 21, 2026
@MrGVSV MrGVSV added D-Trivial Nice and easy! A great choice to get started with Bevy D-Macros Code that generates Rust code labels May 21, 2026
Copy link
Copy Markdown
Contributor

@ChristopherBiscardi ChristopherBiscardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. confirmed prior behavior on main and fix.

@mockersf mockersf added this pull request to the merge queue May 22, 2026
Merged via the queue into bevyengine:main with commit 5cf5554 May 22, 2026
49 checks passed
@github-project-automation github-project-automation Bot moved this from SME Triaged to Done in Reflection May 22, 2026
@MrGVSV MrGVSV deleted the mrgvsv/opaque-generic-info branch May 22, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Reflection Runtime information about types C-Bug An unexpected or incorrect behavior D-Macros Code that generates Rust code D-Trivial Nice and easy! A great choice to get started with Bevy S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Arc<T>::type_info does not contain generics information

3 participants