dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.07k stars 4.04k forks source link

IOperation nodes dropped for XmlMemberAccessExpressionSyntax #27564

Open mavasani opened 6 years ago

mavasani commented 6 years ago

Seems like we are dropping lot of xml related bound nodes for VB in the operation tree. Attempting to add them with this commit caused failures down the line where we have multiple explicit operation nodes with same syntax. Fixing that issue uncovered presence of cycles in the bound tree where same bound node appears at multiple places in the bound tree, leading to asserts.

Note that whenever we fix this issue, we also need to uncomment an assert in ControlFlowGraphBuilder and add relevant CFG unit test(s).

mavasani commented 5 years ago

dotnet/roslyn-analyzers#2395 raises another false positive from IOperation analyzer in presence of XML syntax nodes (XmlElement in the provided repro). We drop the entire tree under XmlElement leading to false positives from unused parameter analyzer. We may want to prioritize this issue to ensure we are not dropping child operations in presence of VB XmlXXX syntax nodes.

Tagging @dotnet/analyzer-ioperation @AlekseyTs @333fred @jinujoseph @KathleenDollard

mavasani commented 5 years ago

Also reported here, which is identical to #dotnet/roslyn-analyzers#2395