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

SA1137 is not raised in C# 12 collection expressions #3904

Open
ar-schraml opened this issue Nov 22, 2024 · 0 comments
Open

SA1137 is not raised in C# 12 collection expressions #3904

ar-schraml opened this issue Nov 22, 2024 · 0 comments

Comments

@ar-schraml
Copy link

The error code SA1137: Elements should have the same indentation is not raised in C# 12 collection expressions.

Example:
image
SA1137 is correctly raised inside an object initialization (example1), but it is missing in collection expressions (example2)

Example code

    private readonly List<string> example1 = new()
    {
        "a",
"b",
                "c",
    };

    private readonly List<string> example2 =
    [
        "a",
"b",
                "c",
    ];

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