Fix check for types interesting to dataflow#105642
Conversation
| [UnexpectedWarning ("IL2067", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/101211")] | ||
| static unsafe void RequirePublicMethods ( | ||
| [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] | ||
| Type* typePtr) |
There was a problem hiding this comment.
Just to make sure I understand what's going on here: we do not consider pointers of Type to be interesting, right? Or is #101211 saying that we shouldn't be doing that, but we are?
There was a problem hiding this comment.
Type* should not be considered for dataflow analysis. All the tools correctly report IL2098 due to invalid annotations on uninteresting Type*.
#101211 is about the analyzer still considering Type* in dataflow analysis, and incorrectly reporting IL2067 about annotations on typePtr mismatching the requirements of RequirePublicFields. Basically the IsTypeInterestingForDataflow check isn't wired up correctly in the analyzer, so it only impacts the IL2098 warnings, not the dataflow warnings.
|
/ba-g "Helix work item dead-lettered" |
This makes the check
IsTypeInterestingForDataflowmore consistent across ILLink/ILC/analyzer.Fixes #104761, and fixes analyzer behavior for byrefs of string.
@dotnet/appmodel PTAL