Skip to content
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

SA1515 (Single-line comment must be preceded by blank line) should not be reported for single line comment directly following a C# 7 case #2462

Closed
AArnott opened this issue Jun 24, 2017 · 1 comment
Assignees
Milestone

Comments

@AArnott
Copy link
Contributor

AArnott commented Jun 24, 2017

When using C# 7 case statements (with type testing included), SA1515 should not flag single-line comments.

The following snippet produces such a warning in StyleCop.Analyzers 1.0.2:

static void Main(object foo)
{
    switch (foo)
    {
        case string s:
            // hi there
            return;
        default:
            break;
    }
}
@AArnott
Copy link
Contributor Author

AArnott commented Jun 24, 2017

This was previously fixed in #878 but the C# 7 syntax seems to throw it off again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants