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

Fix S3267 FN: Support list pattern #6387

Closed
cristian-ambrosini-sonarsource opened this issue Nov 21, 2022 · 0 comments · Fixed by #6414
Closed

Fix S3267 FN: Support list pattern #6387

cristian-ambrosini-sonarsource opened this issue Nov 21, 2022 · 0 comments · Fixed by #6414
Assignees
Labels
Type: False Negative Rule is NOT triggered when it should be.
Milestone

Comments

@cristian-ambrosini-sonarsource
Copy link
Contributor

Description

FN for S3267 (LoopsAndLinq).

Using C#11 list pattern, the rule is not raising an issue.

Repro steps

        void ListPattern(List<int[]> list)
        {
            foreach (int[] array in list) // FN
            {
                if (array is [1, 2, 3]) // FN
                {
                    Console.WriteLine("Test");
                }
            }
        }

Expected behavior

The rule should raise an issue.

Actual behavior

The rule does not raise an issue.

@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource added Type: False Negative Rule is NOT triggered when it should be. Area: C# 11 labels Nov 21, 2022
@github-actions github-actions bot added this to False Negative in Backlog Nov 21, 2022
@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource changed the title Fix S3267 FN: Support utf-8 literals Fix S3267 FN: Support list pattern Nov 21, 2022
@csaba-sagi-sonarsource csaba-sagi-sonarsource added this to the 8.50 milestone Nov 21, 2022
@gregory-paidis-sonarsource gregory-paidis-sonarsource moved this from To do to In progress in Best Kanban Nov 22, 2022
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Nov 22, 2022
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Nov 24, 2022
@gregory-paidis-sonarsource gregory-paidis-sonarsource moved this from In progress to Review in progress in Best Kanban Nov 24, 2022
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Nov 25, 2022
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Nov 25, 2022
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Nov 29, 2022
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Nov 30, 2022
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Dec 1, 2022
@gregory-paidis-sonarsource gregory-paidis-sonarsource moved this from In progress to Review in progress in Best Kanban Dec 1, 2022
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Dec 1, 2022
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Dec 1, 2022
@csaba-sagi-sonarsource csaba-sagi-sonarsource modified the milestones: 8.50, 8.51 Dec 1, 2022
@github-actions github-actions bot moved this from Review in progress to Review approved in Best Kanban Dec 2, 2022
Backlog automation moved this from False Negative to Done Dec 6, 2022
Best Kanban automation moved this from Review approved to Validate Peach Dec 6, 2022
@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource moved this from Validate Peach to Done in Best Kanban Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: False Negative Rule is NOT triggered when it should be.
Projects
Best Kanban
  
Done
Backlog
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants