dotnet / dotnet/dotnet-api-docs
XML documentation comments and exception message of MemoryMarshal.Cast are inaccurate
Open
area-System.Runtime.InteropServices
untriaged
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
https://github.com/dotnet/runtime/blob/3bacc83b4f3d21df591cc25b667b5198d8cebcff/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs#L102-L121
(also the `ReadOnlySpan<>` overload)
1. It doesn't just work on primitive types.
2. (Unmanaged) pointers are OK.
3. The error message with `ThrowHelper.ThrowInvalidTypeWithPointersNotSupported` is also inaccurate: "...Only value types without pointers or references are supported."
Contributor guide
Assessment
This issue has not been assessed yet.