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
From discussion with Neal and Mads today, it would be nice if (x, y) = (1, 2); didn't require the System.ValueTuple types.
Presently, the only deconstruction where ValueTuple is not referenced is when the right-hand-side is a non-tuple expression and the result of the deconstruction-assignment expression is not used (see #18629).
One difficulty with this is, what will the semantic model show for the right-hand-side?
Also, when we do this, we should think about safe-to-escape rules. We may want to do element-wise checks (including nested deconstructions and foreach-deconstructions). The scenario is (global1, local1) = (global2, local2);.
Note: although ValueTuple is required to bind, not reference to it ends up emitted.
From discussion with Aleksey that makes sense: the language says there is an expression on the right-hand-side of the deconstruction, and it is a tuple.
I need to check with Neal and Mads whether that is sufficient/acceptable.
From discussion with Neal and Mads today, it would be nice if
(x, y) = (1, 2);
didn't require theSystem.ValueTuple
types.Presently, the only deconstruction where
ValueTuple
is not referenced is when the right-hand-side is a non-tuple expression and the result of the deconstruction-assignment expression is not used (see #18629).One difficulty with this is, what will the semantic model show for the right-hand-side?
Also, when we do this, we should think about safe-to-escape rules. We may want to do element-wise checks (including nested deconstructions and foreach-deconstructions). The scenario is
(global1, local1) = (global2, local2);
.FYI @gafter
The text was updated successfully, but these errors were encountered: