Rule SA1009 should deal with closing parenthesis as the end of a value tuple
See original GitHub issueThe Rule SA1009 is defined as: "A closing parenthesis should never be preceded by whitespace. In most cases, a closing parenthesis should be followed by a single space, unless the closing parenthesis comes at the end of a cast, or the closing parenthesis is followed by certain types of operator symbols, such as positive signs, negative signs, and colons.
If the closing parenthesis is followed by whitespace, the next non-whitespace character should not be an opening or closing parenthesis or square bracket, or a semicolon or comma."
In some cases the closing parenthesis can be used to define a value tuple. If, for example, a list of value tuples is defined, the syntax can be like
IEnumerable<(string a, int b)> tupleList;
.
I suggest to add the “greater-than-sign” as an additional exception for the rule SA1009 to allow these code structures.
Maybe code changes concerning this issue can be combined with a solution for the issue Rule SA1008 should add => for expression based properties/functions as exception by handling value tuples generally.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top GitHub Comments
I’m using .NET 4.6.2 and 1.1.0-beta4 and still seeing this error.
@DrGriff that is expected; see https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2522#issuecomment-325152888 above