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

Support unmanaged generic constraint for interop with C# #604

Open
fitdev opened this issue Jul 21, 2021 · 0 comments
Open

Support unmanaged generic constraint for interop with C# #604

fitdev opened this issue Jul 21, 2021 · 0 comments

Comments

@fitdev
Copy link

fitdev commented Jul 21, 2021

I have seen a few issue related to this from 2-3 years ago, however they seem to be closed. I am bringing this up again, because I feel like there is an even greater need for this now, in 2021, than in the past for the following reasons:

  • C# 10 will soon be released, whereas the unmanaged constraint was introduced in 7.3, and so by now this is a pretty well known feature of the language and more and more APIs are/will be using it in their public surface.
  • As .Net (Core) matures with version 6 and beyond, considering that VB is not really evolving, and all the coolest runtime-related features are being implemented in/fro C#, - this will drive the migration from VB to C# even more (people do want to take advantage of the new features in the runtime). As part of this process, the need for interop with C# will be great, and the lack of unmanaged constraint support is a serious stumbling block (as is in my case for example).

At the very least, you should consider treating all Enums in VB as valid for unmanaged constraint. That is: it will be already a big step if you just enable it for enums, and it likely ahrdly requires any work, since VB compiler already knows which types are enums and which aren't (no need for more complex logic to determine if the type is unmanaged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant