Spread operator for nested field updates
When using ReScript syntax in BuckleScript 9.0.2, I currently have to write expressions like this to create a copy of a record x with an updated nested field value:
{...x, fields: {...x.fields, lookingFor: { ...x.fields.lookingFor, friends: value }}}
It would be simpler and nicer to achieve the same effect through:
{...x, fields.lookingFor.friends: value }
moved to syntax repo since this needs some syntax update. Previous discussions: https://github.com/ocaml/ocaml/pull/291 I am generally in favor of this feature (implemented in the front-end)
The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.