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

Ref struct type flag #358

Closed
JPaja opened this issue Sep 19, 2022 · 1 comment
Closed

Ref struct type flag #358

JPaja opened this issue Sep 19, 2022 · 1 comment
Labels
dotnet Issues related to AsmResolver.DotNet enhancement
Milestone

Comments

@JPaja
Copy link
Contributor

JPaja commented Sep 19, 2022

Problem Description

new ref Struct have special custom attribute called "IsRefLike" that differentiate them from normal structs
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-7.2/span-safety#metadata-representation-of-ref-like-structs

Additionally System.Type has property called IsByRefLike which indicates ref struct
https://learn.microsoft.com/en-us/dotnet/api/system.type.isbyreflike?view=net-6.0

Proposal

Add Property called "IsRefLike" or "IsByRefLike" that checks if IsRefLike attribute is present on certain Type

Alternatives

No response

Additional Context

No response

@Washi1337 Washi1337 added the dotnet Issues related to AsmResolver.DotNet label Sep 20, 2022
@Washi1337
Copy link
Owner

Adding a IsByRefLike property would make the most sense to me, to stay consistent with other APIs.

It can probably be implemented in a similar fashion as the IsReadOnly property (See TypeDefinition.cs#L497).

We could maybe include this in the upcoming 5.0.0 release as well.

@Washi1337 Washi1337 added this to the 5.0.0 milestone Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet Issues related to AsmResolver.DotNet enhancement
Projects
None yet
Development

No branches or pull requests

2 participants