Open rahxephon89 opened 2 months ago
Better to support * <expr>
as a (sub)Pattern, where <expr>
is a &mut
, but only in the case of an assignment. That would include the desired case as an instance, while being less hacky.
I think both the solution discussed here aren't ideal. We do not want to make patterns more powerful then needed in most use cases and keep them clean, so I'm not in favor of extending patterns. We can also not relax something here, like I said in the slack discussion. (This issue text seems to ignore the slack discussion.) Rather we need to make exp = exp
assignment work also when lhs is a tuple via syntactic lookaheead. In any case, I don't think this is a very urgent issue.
🚀 Feature Request
Currently, Move does not support the syntax:
Because when appearing on lhs, the value inside a tuple can only be
a local, a field write, or a deconstructing assignment
. It would be nice if we could relax this restriction.