-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve span conversion tests #74387
Improve span conversion tests #74387
Conversation
0cf46ef
to
c899a80
Compare
var comp = CreateCompilationWithSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); | ||
var comp = CreateCompilationWithSpanAndMemoryExtensions(source, | ||
parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion), | ||
noStringToReadOnlySpanConversionInSource: true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only place
noStringToReadOnlySpanConversionInSource
is used? If so, could we just special-case this use?
Yes, you're right, I will add only what's needed from the span source into the test and revert the complicated workaround, thanks.
And is this a scenario where we expect to support the non-standard definition?
Yes, the non-standard user-defined operator from string
to ROS<T>
is expected to be supported here - because we do not ignore UDCs from null
to ROS<T>
(see #74002 (comment)), so the UDC is used.
This reverts commit 2e98bd2.
Follow up on #74232 (comment), i.e., switching to
CreateCompilationWithSpanAndMemoryExtensions
so Span from the .NET runtime library is used in tests when not running on .NET Framework. The rest are modifications needed because of that.I'm doing these modifications before merging main into the feature branch so that the merge PR doesn't need to contain any non-trivial changes like this. (Some changes would be needed even if we didn't switch to
CreateCompilationWithSpanAndMemoryExtensions
because of the Span sources consolidation in #74281.)Commit-by-commit review might be useful. (EDIT: Skip the fourth one 2e98bd2 as it's been reverted.)
Test plan: #73445