StyleCop icon indicating copy to clipboard operation
StyleCop copied to clipboard

SA1615 should NOT be reported for an indexer

Open RobSiklos opened this issue 8 years ago • 0 comments

For some reason, SA1615 (ElementReturnValueMustBeDocumented) fires for indexers. This is weird, since all the .NET docs on MSDN use <value> for indexer properties, not <returns>.

The strange thing is, it seems this behaviour exists on purpose. See https://stylecop.codeplex.com/workitem/6924.

As commenter JonHanna said in the above link, the change should not have been made in the first place, because: First: Indexers do not always return values, as they can be set-only. Second: It is normal for properties to use tags, not tags, to describe the value get and/or set.

Can this change be corrected, so StyleCop checks for <value> instead of <returns> on indexers?

Someone please approve this change, and I'll submit a pull request.

RobSiklos avatar Mar 22 '17 20:03 RobSiklos