-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Dereferencing Arrays Is Not Possible #6397
Labels
audit-report
Related to the audit report
Comments
esdrubal
added a commit
that referenced
this issue
Feb 19, 2025
Implements dereferencing as LHS in reassignments for projections. With this PR we will support: - `(*array)[0] = 1` - `(*tuple).0 = 1` - `(*struct).a = 1` This allow includes support for nested references. Fixes #6397
8 tasks
esdrubal
added a commit
that referenced
this issue
Feb 19, 2025
Implements dereferencing as LHS in reassignments for projections. With this PR we will support: - `(*array)[0] = 1` - `(*tuple).0 = 1` - `(*struct).a = 1` This allow includes support for nested references. Fixes #6397
esdrubal
added a commit
that referenced
this issue
Feb 19, 2025
Implements dereferencing as LHS in reassignments for projections. With this PR we will support: - `(*array)[0] = 1` - `(*tuple).0 = 1` - `(*struct).a = 1` This allow includes support for nested references. Fixes #6397
esdrubal
added a commit
that referenced
this issue
Feb 19, 2025
Implements dereferencing as LHS in reassignments for projections. With this PR we will support: - `(*array)[0] = 1` - `(*tuple).0 = 1` - `(*struct).a = 1` This allow includes support for nested references. Fixes #6397
esdrubal
added a commit
that referenced
this issue
Feb 25, 2025
Implements dereferencing as LHS in reassignments for projections. With this PR we will support: - `(*array)[0] = 1` - `(*tuple).0 = 1` - `(*struct).a = 1` This allow includes support for nested references. Fixes #6397
esdrubal
added a commit
that referenced
this issue
Feb 26, 2025
Implements dereferencing as LHS in reassignments for projections. With this PR we will support: - `(*array)[0] = 1` - `(*tuple).0 = 1` - `(*struct).a = 1` This allow includes support for nested references. Fixes #6397
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Sway, developers can create a mutable reference to a variable using something like the following
snippet:
As expected this updates the value of x. However, a mutable reference is not really usable in case of an
array due to limitations in the parsing. In particular, the parser prohibts the use of parentheses on the
left-hand-side of an assignment. The following snippet does not compile:
The text was updated successfully, but these errors were encountered: