Skip to content

XML documentation comments and exception message of MemoryMarshal.Cast are inaccurate #11319

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

Open
tfenise opened this issue May 7, 2025 · 2 comments
Labels
area-System.Runtime.InteropServices untriaged New issue has not been triaged by the area owner

Comments

@tfenise
Copy link
Contributor

tfenise commented May 7, 2025

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."
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label May 7, 2025
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 7, 2025
@jkotas jkotas removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 8, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

@colejohnson66
Copy link
Contributor

colejohnson66 commented May 8, 2025

FYI: The XML documentation comments in this repo are not the ones used to generate the actual documentation. The actual documentation is in @dotnet/dotnet-api-docs.

@agocke agocke added untriaged New issue has not been triaged by the area owner area-System.Runtime.InteropServices labels May 19, 2025
@agocke agocke transferred this issue from dotnet/runtime May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime.InteropServices untriaged New issue has not been triaged by the area owner
Projects
Status: No status
Development

No branches or pull requests

4 participants