Added parsing tests for nested cases in switch statements. #1
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.
A couple of parser tests for nested
@unknown _
.This is a work in progress. It looks like the order of the
case
clauses with@unknown _
causes some confusion in the exhaustivity checker, but I'm not 100% sure yet.I put the
// expected-X
entries in for the diagnostics I actually receive, not the correct ones, so these pass right now but I think they should not in some cases.I might not be understanding some of the behavior. My sense is that the ordering of
case
clauses should be 1. concrete matches, then 2.@unknown _
in combination with concrete matches, then 3.@unknown default
or justdefault
.But I have not reasoned that out completely yet. It's possible that you can't or should not keep that ordering when you have nested
case
clauses in either tuples or structs and get the correct behavior.