Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Change requires on type checking for mismatch - #2766

Merged
tlakollo merged 4 commits into
dotnet:mainfrom
tlakollo:ChangeRequiresOnTypeCheckingForMismatch
Apr 26, 2022
Merged

tlakollo merged 4 commits into
dotnet:mainfrom
tlakollo:ChangeRequiresOnTypeCheckingForMismatch

Conversation

@tlakollo

Copy link
Copy Markdown
Contributor

Fixes #2763

…ng if the member is in Requires scope. This means that now only members that are constructors and static would be considered members annotated with Requires attribute

Change the tests warnings
Add comment about new linker issue.

@sbomer sbomer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@tlakollo
tlakollo merged commit 6ffb647 into dotnet:main Apr 26, 2022
@tlakollo
tlakollo deleted the ChangeRequiresOnTypeCheckingForMismatch branch April 26, 2022 22:37
[ExpectedWarning ("IL2046", ProducedBy = ProducedBy.Analyzer)]
[ExpectedWarning ("IL3051", ProducedBy = ProducedBy.Analyzer)]
// Should not warn since the members are not static
public override void Method ()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please add a test in the other direction as well - since the code should handle it symmetrically now.

agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
If a member creates a requirement ask the override/virtual member if it fulfills the requirement and only then warns.
Fixes dotnet/linker#2763

Commit migrated from dotnet/linker@6ffb647
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Analyzer: RUC/RDC on type triggers override mismatch warnings

4 participants