-
Notifications
You must be signed in to change notification settings - Fork 223
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 #6414
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I just left a few comments for minor stuff
analyzers/tests/SonarAnalyzer.UnitTest/TestCases/LoopsAndLinq.CSharp11.cs
Outdated
Show resolved
Hide resolved
995aa93
to
7db3613
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last indentation comment
foreach (var array in list) // Compliant, do not raise on var pattern in ListPattern | ||
{ | ||
if (array is [1, var x, var z]) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following up on the previous comment, if someone re-wrote this as a Linq Where, the x
and y
variables would not be properly scoped inside the if
statement. Same with is ... local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
analyzers/tests/SonarAnalyzer.UnitTest/TestCases/LoopsAndLinq.CSharp11.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Only a bit more left and it can be merged.
analyzers/tests/SonarAnalyzer.UnitTest/TestCases/LoopsAndLinq.CSharp11.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last round of comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last change requested, promise :)
Kudos, SonarCloud Quality Gate passed! |
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes #6387