-
Notifications
You must be signed in to change notification settings - Fork 84
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
C# 7.x §C.3 AsyncMethodBuilderAttribute has AttributeTargets.Method #858
Milestone
Comments
This was referenced Jul 14, 2023
jskeet
added a commit
to jskeet/csharpstandard
that referenced
this issue
Aug 7, 2023
- `Task` and `Task<T>` are classified as task types despite not specifying builder types - Interfaces are allowed to be task types - Enums and methods are prohibited from being decorated with AsyncMethodBuilderAttribute - Task types must not be generic in more than one type parameter (including in terms of containing types) Discussion required for all of this, but if merged, would fix dotnet#854, dotnet#856, dotnet#858 and dotnet#859.
Merged
BillWagner
pushed a commit
that referenced
this issue
Aug 15, 2023
* Clarify task types - `Task` and `Task<T>` are classified as task types despite not specifying builder types - Interfaces are allowed to be task types - Enums and methods are prohibited from being decorated with AsyncMethodBuilderAttribute - Task types must not be generic in more than one type parameter (including in terms of containing types) Discussion required for all of this, but if merged, would fix #854, #856, #858 and #859. * Prevent nesting within generic types, for task types. This wording follows the wording in 15.15.2 for task builders.
Closed by #875. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
In the C# 7.x draft, §C.3 (Standard Library Types not defined in ISO/IEC 23271), AsyncMethodBuilderAttribute has
AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Method
. Of these, AttributeTargets.Method is not needed for C# 7.3 and instead corresponds to a C# 10 feature.Example
This should not be allowed in a C# 7.3 implementation without extensions.
Expected behavior
In §C.3, remove AttributeTargets.Method from AsyncMethodBuilderAttribute.
Additional context
The C# 7.0 Async Task Types in C# proposal does not mention AttributeTargets.
dotnet/runtime#50116 added AttributeTargets.Method to AsyncMethodBuilderAttribute, for the C# 10 AsyncMethodBuilder override proposal dotnet/csharplang#1407.
The text was updated successfully, but these errors were encountered: