Give an example in the non-exhaustive diagnostic#44702
Give an example in the non-exhaustive diagnostic#44702gafter merged 12 commits intodotnet:masterfrom
Conversation
bcfdde5 to
8dd7aed
Compare
|
@alrz Are there any tests you suggest I add before opening this up for review? #Resolved |
|
I wonder what example we give for: return unsigned switch
{
0 => true,
var x when x > 0 => false,
};I would expect |
|
We give the example '1', as we don't know if the In reply to: 641706686 [](ancestors = 641706686) |
|
Actually, I'd like to open this up for review and handle the "However" clause of the diagnostic in a separate PR (#45157). But I definitely agree we should do that. #Resolved |
…ns3-nonexhaustive-example
|
@dotnet/roslyn-compiler May I please have a couple of reviews? #Resolved |
Related to dotnet#45234
src/Compilers/CSharp/Portable/Utilities/ValueSetFactory.FloatingValueSet.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Utilities/ValueSetFactory.NumericValueSet.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Utilities/ValueSetFactory.NumericValueSet.cs
Outdated
Show resolved
Hide resolved
- Fix a typo - Make IValueSet methods throw an exception when empty - Simplify NumericValueSet's selection when there are no positive values
Properly produce `{ }` after all single-element deconstructions.
|
@dotnet/roslyn-compiler May I please have a review from a Sr engineer? #Resolved |
src/Compilers/CSharp/Portable/Utilities/ValueSetFactory.EnumeratedValueSet.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Utilities/ValueSetFactory.EnumeratedValueSetFactory.cs
Outdated
Show resolved
Hide resolved
| var elementTemp = new BoundDagTemp(e.Syntax, e.Field.Type, e); | ||
| var index = e.Field.TupleElementIndex; | ||
| if (index < 0 || index >= cardinality) | ||
| return null; |
There was a problem hiding this comment.
return null [](start = 28, length = 11)
Are we testing this case? #Resolved
There was a problem hiding this comment.
No. It would just cause us not to produce a tuple pattern in the face of a bad tuple API declaration. We would use a property pattern instead with Item1 etc.
In reply to: 443843360 [](ancestors = 443843360)
There was a problem hiding this comment.
…ns3-nonexhaustive-example
jasonmalinowski
left a comment
There was a problem hiding this comment.
Signing off on the skipping of the IDE test only.
Fixes #43943