Clarify that a switch expression may have no type#1734
Merged
Conversation
Nigel-Ecma
approved these changes
Jul 19, 2026
Nigel-Ecma
left a comment
Contributor
There was a problem hiding this comment.
I think this approach fits into the existing approach to ”no type”.
I would probably myself drop lines 3882-3 as they just repeat what is said in the xref and instead add the xref to line 3885 – more succinct, but that is subjective!
Contributor
Author
Makes sense - have done that in another commit (as well as reverting an accidental incomplete change for a different issue). |
BillWagner
reviewed
Jul 22, 2026
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
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 #1651.
I don't think we need to talk about "if a switch expression is not subject to..." - we just say that the expression has no type, but can be converted to some types, and let the rest of the language rules handle it.
We may want to add examples, e.g.:
varvariablevarvariableI don't know whether those examples are really needed though.