Skip to content

SA1118 false positive with multi-line collection expressions as arguments #3732

@ecampidoglio

Description

@ecampidoglio

Passing a multi-line collection expression as argument in C# 12 triggers SA1118:

// ⚠️ SA1118 The parameter spans multiple lines
foo.Bar(
    [
        "foo",
        "bar",
        "baz"
    ]);

Specifying the elements on the same line does not trigger the warning:

foo.Bar(["foo", "bar", "baz"]);

This is on version 1.2.0-beta.507.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions