Open jtschuster opened 5 months ago
Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas See info in area-owners.md if you want to be subscribed.
The analyzer behavior fell out of the control-flow graph representation. It's one of those cases where the analyzer would have to do extra work to not recognize that pattern, but the other tools would have to do extra work to recognize it. Personally I'm more inclined to teach the other tools to recognize it.
But I also agree that ideally the analyzer would match the other tools. I haven't looked into it yet, but if it's simple enough to make the analyzer not recognize the pattern I would be supportive.
The trim analyzer recognizes and understands
&&
and||
and will not warn for code that is guarded by a feature guard, but the trimmer and ilc don't understand it and will not eliminate the branch with problematic code and will warn if there is code that should be considered guarded.This is expected according to the feature-checks docs: https://github.com/dotnet/runtime/blob/main/docs/design/tools/illink/feature-checks.md#boolean-andor
If neither tool recognizes the pattern and will warn, does it make sense for the analyzer to not warn and leave the user surprised at publish?