You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This forces the type to have these implementations even when some of its members cannot have a certain trait. For example we have a Foo component that has a Felt252Dict<u8> for one of its members.
As shown below, this results in an error by the compiler it contains a dictionary and it cannot be copied
error: Invalid copy trait implementation, Trait has no implementation in context: core::traits::Copy::<core::dict::Felt252Dict::<core::felt252>>
--> impls:1:1
impl FooCopy of Copy::<Foo>;
^**************************^
Possible solutions
Remove this derive magic and have developers explicitly derive traits
Keep Component abstraction and add a CustomComponent that developers can opt into if they want to have custom traits implemented
The text was updated successfully, but these errors were encountered:
Context
Currently, these traits are implemented on each Component (see https://github.com/dojoengine/dojo/blob/main/crates/dojo-lang/src/component.rs#L82)
This forces the type to have these implementations even when some of its members cannot have a certain trait. For example we have a
Foo
component that has aFelt252Dict<u8>
for one of its members.As shown below, this results in an error by the compiler it contains a dictionary and it cannot be copied
Possible solutions
CustomComponent
that developers can opt into if they want to have custom traits implementedThe text was updated successfully, but these errors were encountered: