-
-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Roslyn have analyzers for usage of tree modification api: https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/RulesMissingDocumentation.md?plain=1#L18
Today I spend some time for searching bug in this code:
public void MyMethod(...)
{
XmlDocumentSyntax document = ...;
document.ReplaceNode(...);
return document;
}Same code in Roslyn return diagnostic:
Warning RS1014 'ClassDeclarationSyntax' is immutable and 'AddBaseListTypes' will not have any effect on it. Consider using the return value from 'AddBaseListTypes'.
Many objects exposed by Roslyn are immutable. The return value from a method invocation on these objects should not be ignored.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels