-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Block manual application of MethodImplAttribute.Async to methods #80031
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
Conversation
|
@jcouv @RikkiGibson for review |
src/Compilers/Core/Portable/Symbols/Attributes/CommonAttributeData.cs
Outdated
Show resolved
Hide resolved
jcouv
left a comment
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.
Done with review pass (commit 1)
| // Error if [MethodImpl(MethodImplOptions.Async)] is used directly on a method | ||
| // We give an exception to the AsyncHelpers special type, as it manually implements the pattern as part of the | ||
| // runtime's async support | ||
| if ((InternalSpecialType)appliedToSymbol.ExtendedSpecialType != InternalSpecialType.System_Runtime_CompilerServices_AsyncHelpers) |
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.
aside, and not part of your PR. but using a cast like this to go from a struct wrapper to an enum was absolutely not clear to me :D
CyrusNajmabadi
left a comment
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.
Signing off as my questions are not blocking and the code seems clear and in line with corresponding surrounding code.
jcouv
left a comment
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.
LGTM Thanks (commit 4)
Relates to test plan #75960