Skip to content

Rule SA1010 conflicts with rule SA1001 for collection expressions in method invocations #88

@thygesteffensen

Description

@thygesteffensen

SA1010: Opening square brackets should not be preceded by a space.
SA1001: Commas should be followed by whitespace.


This snippet will make the two rules conflict.

method.Invoke(executor, [nextAction.Value.Key, input]);

Before C# 12, this would have been:

method.Invoke(executor, new object[] { nextAction.Value.Key, input })

C# 12 introduced collection expressions, which makes the two rules conflict.

Metadata

Metadata

Assignees

No one assigned

    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