Document C# extension: [return: attribute] on accessor that returns void
See original GitHub issueThe Roslyn C# compiler allows a return
attribute_target_specifier in the following contexts, where ECMA-334 5th edition § 22.3 (Attribute specification) does not allow it:
add
accessor of an eventremove
accessor of an eventset
accessor of a propertyset
accessor of an indexer
Please document this extension, to comply with ECMA-334 5th edition chapter 2:
A conforming implementation of C# shall be accompanied by a document that defines all implementation-defined characteristics, and all extensions.
The feature used to be documented at https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/attributes#attribute-specification, but it was not marked as an extension, and anyway has been removed from that document, which now comes from an ECMA C# draft.
I imagine the extension could be documented in https://github.com/dotnet/roslyn/tree/main/docs/compilers/CSharp, which already describes some other extensions (if a directory can be considered “a document”), or perhaps in https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/.
Split from https://github.com/dotnet/csharpstandard/issues/340.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (7 by maintainers)
@BillWagner Based on this, I think the document should live in the roslyn repo (ie. the implementation). What do you think?
Good catch. We do need to keep this open for a Roslyn change.