Skip to content

SA1009 - Behavior in Switch expression #3835

Closed

Description

@modestotech

Version: 1.2.0-beta.556
.NET version: 8

I'm working with a switch expression like below:
image

This gives the SA1009 error.

StyleCop wants me to put it like this:
image

Doesn't look nice, and when reading the in the docs about SA1009 it seems there are some exceptions to this rule (cast), so maybe some logic needed here to handle switch expressions.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions