Should GenAPI be removing the AsyncMethodBuilder attribute?
See original GitHub issueSee https://github.com/dotnet/corefx/pull/35557#discussion_r259772806
This attribute is required to avoid compiler errors (for verifying that async methods return a task-like type), but it is being excluded here: https://github.com/dotnet/corefx/blob/26b932e3c56702382d13ece010b300d3181d2891/eng/DefaultGenApiDocIds.txt#L53
error CS1983: The return type of an async method must be void, Task, Task<T>, a task-like type, IAsyncEnumerable<T>, or IAsyncEnumerator<T>
Given that behaviour, we should consider removing the exclusion from the list.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
AsyncMethodBuilder override - C# 10.0 draft feature ...
This feature specification describes new rules to enable types to override the default AsyncMethodBuilder. This will be used by the runtime ...
Read more >c# - Why does my async method builder have to be a class ...
The Task property and the SetResult method both execute concurrently; The SpinLock does not mutually exclude the respective blocks of code (they ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It must not remove it. This is a key part of using arbitrary task-like types as the return type of an async method. It’s more than just a compiler error: the reason for the error is the compiler needs to know what builder to use for that type as part of compiling the method.
I’m ok with tracking this in arcade, since currently the reference is up to date. Here’s the PR where I tried to enable this: https://github.com/dotnet/corefx/pull/37482