-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Keep ref struct interfaces behind preview flag #73923
Comments
I have some code like this in some scenarios that require very low overhead to be useful: interface IAction
{
void Run(/*extra parameters here for some variants of it*/);
} And I was hoping to update it to allow ref struct IActions so that I didn't have to do the pointer trick in these cases. (Note that I pass the generic I will post more use cases when I have a chance to go through more of the code where I ran into similar issues as I find or think of them. |
@hamarb123 Note, the plan is to keep ability for ref structs to implement interface behind a preview flag, the |
While We want to expose |
…uct constraint. Related to dotnet#73923.
LDM confirmed that we want to ship this aspect of the feature in NET 9/C# 13. See https://github.com/dotnet/csharplang/blob/main/meetings/2024/LDM-2024-07-22.md#ref-structs-implementing-interfaces for more information |
Language design is leaning towards keeping
ref struct
interfaces for .NET 9. There aren't a lot of real world cases and that is leading to concerns on whether we've battle tested the design enough. Leaving in preview would give us more time to evaluate against real world cases and ensure the design is correct.This issue is a place holder to ensure we don't attach it to the new language version when it's defined in the 17.12 milestone.
The text was updated successfully, but these errors were encountered: