-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add RuntimeAsyncMethodGenerationAttribute #77543
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -316,9 +316,7 @@ internal bool IsNullableAnalysisEnabledAlways | |
| /// Returns true if this method should be processed with runtime async handling instead | ||
| /// of compiler async state machine generation. | ||
| /// </summary> | ||
| #pragma warning disable IDE0060 // Remove unused parameter | ||
| internal bool IsRuntimeAsyncEnabledIn(MethodSymbol method) | ||
| #pragma warning restore IDE0060 // Remove unused parameter | ||
| { | ||
| // PROTOTYPE: EE tests fail this assert, handle and test | ||
| //Debug.Assert(ReferenceEquals(method.ContainingAssembly, Assembly)); | ||
|
|
@@ -327,8 +325,12 @@ internal bool IsRuntimeAsyncEnabledIn(MethodSymbol method) | |
| return false; | ||
| } | ||
|
|
||
| // PROTOTYPE: Check for attributes that turn on/off the feature member-by-member | ||
| return true; | ||
| return method switch | ||
| { | ||
| SourceMethodSymbol { IsRuntimeAsyncEnabledInMethod: ThreeState.True } => true, | ||
| SourceMethodSymbol { IsRuntimeAsyncEnabledInMethod: ThreeState.False } => false, | ||
| _ => Feature("runtime-async") == "on" | ||
| }; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's update the compiler spec for how those three flags (runtime feature flag, compiler feature flag, method-level attribute) work together
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will update in main after this PR. |
||
| } | ||
|
|
||
| /// <summary> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.