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
## Description
Adds support for positional struct fields in Move 2024.
This affects the parser, expansion, and naming (and a minor update is
needed in `to_bytecode`).
## Parser
* Updated to support positional struct declarations
* Updated dotted field accesses to support valid struct indices
* Updated binding parsing to support positional struct destructuring
## Expansion
* Added support for conversion of a `Call` to `Unpack` if it's in an
`LValue` position (similar to what we do in expansion for `Pack` to
`Unpack` in LValue position).
## Naming
* Positional fields are removed at this point
* `Call`s are disambiguated into `Packs` or remain as `Call`s based on
the name references an in-scope struct type.
* We enforce that named packs/unpacks and positional packs/unpacks
correspond to a named/positional struct declaration.
## Test Plan
Added a number of tests for each phase.
---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.
### Type of Change (Check all that apply)
- [ ] protocol change
- [X] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration
### Release notes
Adds positional struct declaration support to Move 2024.alpha. When
using the 2024 edition you'll be able to declare structs with positional
fields (e.g., `public struct Positional(u64, bool)`), access positional
struct fields via their index (e.g., `x.0` `,x.1`) and unpack/pack them
positionally (e.g., `let Positional(value, is_tf) = x;`, `let x =
Positional(0, true)`).
0 commit comments