Skip to content
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

Warn on method access in Requires analyzers #110086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jtschuster
Copy link
Member

The issue with calling Methods with requires is the the method itself, not the parameters. Warning on the entire invocation including the parameters can be confusing. Instead, we should warn just on the method access for Requires. DynamicallyAccessedMembers should still warn on the invocation.

Fixes #109823.

The issue with calling Methods with requires is the the method itself,
not the parameters. Warning on the entire invocation including the
parameters can be confusing. Instead, we should warn just on the method
access for Requires. DynamicallyAccessedMembers should still warn on the
invocation.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Nov 22, 2024
@dotnet-policy-service dotnet-policy-service bot added the linkable-framework Issues associated with delivering a linker friendly framework label Nov 22, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/illink
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix LGTM but looks like there are some failures.

Not for this PR, but I'm wondering if it would be better for the DAM analyzer to warn on the specific parameter with a DAM mismatch, instead of the entire invocation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Location (highlighting) of IL2026 diagnostic could be improved
2 participants