Clarify LHS as discard behavior#1639
Open
BillWagner wants to merge 2 commits intodotnet:draft-v8from
Open
Conversation
Fixes dotnet#1631 "zero or more variable_references" → "two or more targets" (grammar requires 2+ elements; targets can be variable_references or discards) Adds: compound_assignment LHS shall not be a discard Adds: simple_assignment and ref_assignment LHS may be a discard Adds: RHS is evaluated even when target is a discard, but no value is stored
jskeet
reviewed
Apr 16, 2026
Nigel-Ecma
requested changes
Apr 26, 2026
Restore the simplified summary paragraph, except for deconstructing assignment requiring 2 or more targets. Add second paragraph describing discard behavior. Add normative sentence that the left operand of a compound assignment can't be a discard.
jskeet
approved these changes
May 5, 2026
Contributor
jskeet
left a comment
There was a problem hiding this comment.
I like this latest version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1631
"zero or more variable_references" → "two or more targets" (grammar requires 2+ elements; targets can be variable_references or discards)
Adds: compound_assignment LHS shall not be a discard
Adds: simple_assignment and ref_assignment LHS may be a discard
Adds: RHS is evaluated even when target is a discard, but no value is stored