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

The interop marshaller should recognize the 'IsReadOnly' attribute #8194

Closed
tannergooding opened this issue May 23, 2017 · 3 comments
Closed

Comments

@tannergooding
Copy link
Member

The C# language is gaining support for ref readonly parameters (dotnet/roslyn#19713 and dotnet/csharplang#38).

Today the marshaller will treat ref as [In, Out] unless explicitly marked as just [In]. That is, by default, it will both initialize with the managed state and then copy back any changes to the instance on return. While, when explicitly marked with just the [In] attribute, it will only initialize with the managed state and will not copy back any changes on return.

Without modification, the marshaller will also treat ref readonly in the same way ([In, Out]). As such, the marshaller should be updated to handle and recognize ref readonly parameters as [In].

@tannergooding
Copy link
Member Author

FYI. @VSadov, @jaredpar

@yizhang82
Copy link
Contributor

yizhang82 commented May 23, 2017

@tannergooding Thanks for logging the issue. Let's take the discussion there on the csharplang issue (which I've commented).

@tannergooding
Copy link
Member Author

Closing this. C# 7.3 is going to ensure the attribute is added.

FYI. @OmarTawfik

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants