proposal-explicit-resource-management
proposal-explicit-resource-management copied to clipboard
Add description of differences between a single declaration with multiple bindings and multiple declarations with single bindings
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.
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.