Users must specify storage type for Component when used as a trait object #3265
Labels
A-ECS
Entities, components, systems, and events
C-Bug
An unexpected or incorrect behavior
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
What problem does this solve or what need does it fill?
When attempting to create a trait object of a
Component
, users must specify the storage type as eitherComponent<Storage=TableStorage>
orComponent<Storage=SparseStorage>
.Reproduction:
If they do not do so, they receive a compiler error like:
This is both somewhat confusing to resolve and frustratingly limiting, as you cannot mix and match storage types within types that you intend to store in the same trait object.
What solution would you like?
Somehow refactor the way storage types are recorded (see bevyengine/rfcs#27 for alternate approaches) to avoid this limitation.
Additional context
Encountered when exploring topics related to #3227.
The text was updated successfully, but these errors were encountered: