Skip to content
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

arc4.Tuple with mutable element changes fails compilation #152

Closed
achidlow opened this issue Mar 26, 2024 · 0 comments · Fixed by #237
Closed

arc4.Tuple with mutable element changes fails compilation #152

achidlow opened this issue Mar 26, 2024 · 0 comments · Fixed by #237
Labels
enhancement New feature or request

Comments

@achidlow
Copy link
Contributor

Although tuples are immutable collections, their individual items can change if they are mutable.

Ideally, the following should compile and execute correctly

t = arc4.Tuple((arc4.UInt64(1), arc4.DynamicBytes(b"abc")))
assert t[1].bytes[2:] == b"abc", "initial value"
t[1].extend(arc4.DynamicBytes(b"def"))
assert t[1].bytes[2:] == b"abcdef", "updated value"
@robdmoore robdmoore added the enhancement New feature or request label Apr 2, 2024
daniel-makerx added a commit that referenced this issue Jun 10, 2024
Reading and writing dynamic ARC4 types in an array
Modifying ARC4 tuple items (#152)
Require ARC4 struct initialisation to have unaliased values to maintain reference semantics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants