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
Recently, the contract implementation style has changed so that the contract struct derives SpreadAllocate.
This causes a compilation error in contracts that make use of enum with more than one variant. This is because it is not possible to determine a default value, so SpreadAllocate is not defined for enum.
It would be nice if enum was allowed if the Default trait was implemented.
Yes, you still need to implement SpreadAllocate for all types that are part of the storage(For enums it should be done manually). It will be changed after resolving #1134
Recently, the contract implementation style has changed so that the contract
struct
derivesSpreadAllocate
.This causes a compilation error in contracts that make use of
enum
with more than one variant. This is because it is not possible to determine a default value, soSpreadAllocate
is not defined forenum
.It would be nice if
enum
was allowed if theDefault
trait was implemented.e.g. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=21d9e01c332a660d9e5ab22634250f1a
Here is my hacked version of making this work in ink: prosopo@bdc676d
The text was updated successfully, but these errors were encountered: