Skip to content

SA1102 documentation should include a working C# snippet example #3754

Closed

Description

@arphox

Hi!

I'm reading https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1102.md and I got confused while reading the code example for the rule. It does not seem compilable C# for me.

I created a fully working example, feel free to use it as you wish.

int[] c = { 1, 2, 3, 4, 5 };
int a = 2;

IEnumerable<int> query = from item in c
                         where item == a

                         select item;

Activity

  1. sharwell commented on Dec 18, 2023

    @sharwell
    Member

    I'm not sure we need to include a complete example that compiles, but we should definitely fix the cases where from and select were reversed.

  2. added this to the 1.2-beta.next milestone on Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions