Additional tests for pattern matching on Span<char>#59876
Additional tests for pattern matching on Span<char>#59876RikkiGibson merged 5 commits intodotnet:features/patterns-span-charfrom
Span<char>#59876Conversation
c8653ee to
fc5cd4f
Compare
fc5cd4f to
fea2e4c
Compare
| "; | ||
| CreateCompilationWithSpan(source, parseOptions: TestOptions.RegularPreview) | ||
| .VerifyEmitDiagnostics( | ||
| .VerifyDiagnostics( |
There was a problem hiding this comment.
The tests for missing members use VerifyEmitDiagnostics() since missing members may affect the synthesized string hash methods.
| } | ||
|
|
||
| constantValue = expression.ConstantValue; | ||
| convertedExpression = BindToNaturalType(expression, diagnostics); |
There was a problem hiding this comment.
Just curious, what scenario was affected? #Resolved
There was a problem hiding this comment.
There were a couple of cases that were affected: matching against a constant interpolated string and matching against a switch expression I believe.
jcouv
left a comment
There was a problem hiding this comment.
LGTM Thanks (iteration 3) with some follow-up discussion about VerifyDiagnostics
4086943 to
b86269e
Compare
|
|
||
| /// <summary> | ||
| /// DecisionDagRewriter.EnsureStringHashFunction() does not generate | ||
| /// a hash function if the span indexer is missing. |
There was a problem hiding this comment.
Should DecisionDagRewriter.EnsureStringHashFunction() report an error if the indexer is missing rather than silently falling back to the non-hash implementation?
|
Once again, we don't think the rebuild failures are caused by this PR. |
Test plan #59191