Change the semantics of Span ToString to return the contents for T=char - #26726
Conversation
|
I don't understand why I am seeing these compiler errors for netfx when I do: Assert.Equal("System.Span<int>[3]", span.ToString());Where is the implicit conversion happening? And this error only occurs for Span (not ReadOnlySpan). |
There is implicit conversion because of System.Memory reference assembly is missing the ToString overload. |
Yes! For both Span and Memory. Also, ReadOnlyMemory in S.Runtime ref is also missing it: https://github.com/dotnet/corefx/blob/master/src/System.Runtime/ref/System.Runtime.cs#L1933 |
I will make this change outside this PR to avoid mirroring issues (along with removing the redundant DebuggerDisplay property - ). |
|
@dotnet-bot test this please |
|
@dotnet-bot test UWP CoreCLR x64 Debug Build |
|
UWP failure is https://github.com/dotnet/corefx/issues/26802 (CI have not picked up the new pipeline definition for existing PRs) |
…ar (dotnet/corefx#26726) * Change the semantics of Span ToString to return the contents for T=char * Updating ToString tests. * Fix the expected value in tests and add Span<string> test. * Add missing ToString methods to the reference assemblies. Commit migrated from dotnet/corefx@928d525


Fixes https://github.com/dotnet/corefx/issues/26584
Related PR: dotnet/coreclr#16143
This PR supersedes #26663
It is blocked:
After dotnet/coreclr#16087 is merged and CoreFX is updated to use the new coreclr version, this PR can be merged.
cc @pakrym, @jkotas, @stephentoub, @dotnet/corefxlab-contrib