proposal-explicit-resource-management icon indicating copy to clipboard operation
proposal-explicit-resource-management copied to clipboard

Add description of differences between a single declaration with multiple bindings and multiple declarations with single bindings

Open benblank opened this issue 2 years ago • 1 comments

The Semantics section of the README emphasizes that using x = expr1, y = expr2; (multiple bindings in a single declaration) is only approximately equivalent to using x = expr1; using y = expr2; (single bindings in multiple declarations, but the same bindings in the same order) — and similarly for await using — but I didn't see a description of the practical differences between them. I also didn't see an existing issue addressing the differences and during a quick scan of the specification diff, I didn't notice a clear explanation, either.

To me, the emphasis on "approximate" equivalence implies that, while the differences between single-declaration/multiple-binding and multiple-declaration/single-binding semantics are not commonly relevant, there do exist differences which are situationally relevant. If that is the case, I feel that at least a quick summary of the differences and their potential relevance is warranted. If not, I feel that implication introduces confusion and that the emphases should be removed.

benblank avatar Sep 09 '23 17:09 benblank

The "approximate" wording was applicable back when we were using AggregateError as there were slight semantic differences to the two declarations.

Now that we are using an independent SuppressedError that has a 1:1 nesting relationship, the two statements are semantically identical.

rbuckton avatar Jun 14 '24 21:06 rbuckton