-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Clarify the rules on UnmanagedCallersOnly #3823
Conversation
@elinor-fung @jkotas @jaredpar @AaronRobinsonMSFT for review. I've updated the rules for UnmanagedCallersOnly following discussion on the implementation of dotnet/roslyn#47008. |
@jkotas addressed feedback. |
1. Simplify the parameter/return requirements. 2. Clarify the intent around invalid imported metadata.
Lgtm |
* It is an error to apply the attribute to anything other than a static method. The C# compiler will mark any non-static | ||
methods imported from metadata with this attribute as unsupported by the language. | ||
* It is an error to have managed types as parameters or the return type of a method marked with the attribute. | ||
* It is an error to apply the attribute to anything other than an ordinary static method or ordinary static local function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering, but why are operators/properties restricted here? Is it just a language limitation, similar to binding against a signature that takes explicit this
for instance methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, this is a language limitation.
No description provided.