-
Notifications
You must be signed in to change notification settings - Fork 222
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
Repro for FP S2589: Assignment for captures are ignored #9205
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.
LGTM
public bool LocalFunctionTest() | ||
{ | ||
var found = false; | ||
Assign(); | ||
if (!found) // Noncompliant FP | ||
{ | ||
Console.WriteLine("No License for artifact type"); | ||
} | ||
return found; | ||
|
||
void Assign() => found = true; // Assignment in local function | ||
} |
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.
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.
I added a reproducer for #8885 as well.
Quality Gate passed for '.NET Analyzers parent'Issues Measures |
Quality Gate passed for 'SonarAnalyzer for .NET'Issues Measures |
@@ -57,7 +57,9 @@ public class ConditionEvaluatesToConstantTest | |||
[DataRow(ProjectType.Test)] | |||
public void ConditionEvaluatesToConstant_Roslyn_CS(ProjectType projectType) => | |||
roslynCS.AddPaths("ConditionEvaluatesToConstant.cs") | |||
.AddReferences(NuGetMetadataReference.MicrosoftExtensionsPrimitives("3.1.7").Concat(TestHelper.ProjectTypeReference(projectType))) | |||
.AddReferences(NuGetMetadataReference.MicrosoftExtensionsPrimitives("3.1.7")) | |||
.AddReferences(MetadataReferenceFacade.SystemComponentModelTypeConverter) |
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.
For System.Timers.Timer
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
Repro for #9204
Repro for #8885