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

Update library/generated callsites of Marshal.QueryInterface for .NET 9 #1388

Open
Sergio0694 opened this issue Nov 14, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@Sergio0694
Copy link
Member

Proposal: update library/generated callsites of Marshal.QueryInterface for .NET 9

Summary

Tracking issue for dotnet/runtime#94470.
Here's my thoughts from dotnet/runtime#94470 (comment):

  • For multi-targeted sources, they can just use ref, and suppress the warning on .NET 9 and above (CS9191). Even without suppressing it, it'll just be a warning though, and not an actual build error. Of course, suppressing it is recommended, but just saying, it should never fail to built outright in this scenario.
  • For source-generated files, they can either also just use ref and suppress the warning again, or detect the signature of the method, pass it down to the incremental model and use that to decide what modifier to emit. Either is doable, of course the latter is a tiny bit more involved.

The general idea is that with .NET 9 changing the signature to in, we need to make sure no scenario is source breaking.

@AaronRobinsonMSFT
Copy link
Member

we need to make sure no scenario is source breaking.

We need a bit more care on this front. Source that is written and owned by a team can easily tolerate new warnings as they can be suppressed in a myriad of forms. However, source that is generated has a higher bar because the levers of control are more limited and can cause friction with company policy. The CsWinRT is free to make the final call here, but I would endevour to avoid warnings in all cases and narrowly suppress so there is no friction on adoption.

@dongle-the-gadget
Copy link
Contributor

dongle-the-gadget commented Nov 30, 2023

I think dealing with that right now should be quite easy, as all files that are using it aren’t generated, but rather predefined.

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

No branches or pull requests

3 participants