Description
Span<ulong> span = MemoryMarshal.Cast<TestStruct, ulong>(arr);
Span span = MemoryMarshal.Cast<TestStruct, ulong>(arr);
"error CS0029: Cannot implicitly convert type 'System.ReadOnlySpan' to 'System.Span'
Correct, an explicit conversion is needed:
Span span = MemoryMarshal.Cast<TestStruct, ulong>(arr.AsSpan());
However, Visual Studio doesn't show this error and doesn't detect it at all - compilation just stops abruptly without showing where the error occurred.
Reproduction Steps
1
Expected behavior
1
Actual behavior
1
Regression?
1
Known Workarounds
No response
Configuration
No response
Other information
No response