-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow staticarrays to be constructed with no arguments #281
base: main
Are you sure you want to change the base?
Conversation
DynamicArray[AddressArray]() | ||
) | ||
# TODO: The following should either work, or fail gracefully | ||
# x = StaticArray[TestStruct, typing.Literal[4]]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume it's possible to add a default ctor to the arc4.Structs but it maybe doesn't make much sense. Is it better to just error when attempting to construct a static array of struct without any values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't jive with the datalcass vibe - not unless the class had default values for all fields (which we don't support yet)
Proposed Changes