Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AppTypeRegistry.read() returns private paths to public types #17337

Closed
SetOfAllSets opened this issue Jan 13, 2025 · 2 comments
Closed

AppTypeRegistry.read() returns private paths to public types #17337

SetOfAllSets opened this issue Jan 13, 2025 · 2 comments
Labels
A-Reflection Runtime information about types C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Wontfix This issue is the result of a deliberate design decision, and will not be fixed

Comments

@SetOfAllSets
Copy link

Bevy version

15.1

What you did

I was looking at this code to fix a bug in blenvy and found that AppTypeRegistry.read() returns inaccessible types

What went wrong

What I was expecting: Return types in a public form (eg: avian3d::prelude::ExternalForce)
What I got: Return types in a private form (eg: avian3d::dynamics::rigid_body::forces::ExternalForce)

@SetOfAllSets SetOfAllSets added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 13, 2025
@MrGVSV MrGVSV added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Reflection Runtime information about types and removed C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 13, 2025
@MrGVSV
Copy link
Member

MrGVSV commented Jan 13, 2025

This is actually by design (mostly). By using the true type path, we're far less likely to run into duplicates paths. And prevents registering a type twice with two different paths.

Of course, this is also a technical limitation. The way TypePath and std::any::type_name work doesn't allow for it to rely on how the type is imported. It's given only given the one path.

The one thing TypePath does allow is setting a custom path for a given type. You could potentially make an issue/PR to Avian to have them manually set these type paths to something like avian3d::prelude::ExternalForce.

So for now I'll close this as won't fix

@MrGVSV MrGVSV closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2025
@MrGVSV MrGVSV added the S-Wontfix This issue is the result of a deliberate design decision, and will not be fixed label Jan 13, 2025
@SetOfAllSets
Copy link
Author

I believe I found the real source of my problem anyway
#17356

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-Reflection Runtime information about types C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Wontfix This issue is the result of a deliberate design decision, and will not be fixed
Projects
None yet
Development

No branches or pull requests

2 participants