Skip to content
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

Merged

Conversation

jjonescz
Copy link
Member

@jjonescz jjonescz commented Jul 15, 2024

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

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 15, 2024
@jjonescz jjonescz marked this pull request as ready for review July 15, 2024 14:23
@jjonescz jjonescz requested a review from a team as a code owner July 15, 2024 14:23
@jjonescz jjonescz requested review from cston and 333fred July 15, 2024 14:23
@jjonescz
Copy link
Member Author

@cston @333fred for reviews, thanks

var comp = CreateCompilationWithSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion));
var comp = CreateCompilationWithSpanAndMemoryExtensions(source,
parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion),
noStringToReadOnlySpanConversionInSource: true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noStringToReadOnlySpanConversionInSource: true

Is this the only place noStringToReadOnlySpanConversionInSource is used? If so, could we just special-case this use? And is this a scenario where we expect to support the non-standard definition? If not, should we test that we're not supporting it?

Copy link
Member Author

@jjonescz jjonescz Jul 16, 2024

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.

@jjonescz jjonescz requested a review from cston July 16, 2024 09:09
@jjonescz jjonescz merged commit bcb24fb into dotnet:features/FirstClassSpan Jul 16, 2024
24 checks passed
@jjonescz jjonescz deleted the FirstClassSpan-11-NetTests branch July 16, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers New Feature - First-class Span Types untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants