TypeName | SA1007OperatorKeywordMustBeFollowedBySpace |
CheckId | SA1007 |
Category | Spacing Rules |
The operator keyword within a C# operator overload method is not followed by any whitespace.
A violation of this rule occurs when the operator keyword within an operator overload method is not followed by any whitespace. The operator keyword should always be followed by a single space. For example:
public MyClass operator +(MyClass a, MyClass b)
{
}
To fix a violation of this rule, add a single space after the operator keyword.
[SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1007:OperatorKeywordMustBeFollowedBySpace", Justification = "Reviewed.")]
#pragma warning disable SA1007 // OperatorKeywordMustBeFollowedBySpace
#pragma warning restore SA1007 // OperatorKeywordMustBeFollowedBySpace