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

ILLink doesn't warn for annotation mismatch for derived method implementing a recursive interface #106552

Open
jtschuster opened this issue Aug 16, 2024 · 1 comment
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers
Milestone

Comments

@jtschuster
Copy link
Member

jtschuster commented Aug 16, 2024

In IL it is valid for an abstract Base to implement I but provide no methods. This is not possible in C#, as Base would not be allowed to be missing M. If Base does provide M, the trimmer does warn there (see RequiresCapability/BaseProvidesInterfaceMethodRequiresMismatch.cs). This is a very niche corner case and not the highest priority.

abstract class Base : I
{
}

class Derived : Base
{
    public virtual void M() {} // warning IL2046
}

interface I
{
    [RequiresUnreferencedCode("RUC")]
    void M();
}

See #103317 (comment)_
for context

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 16, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Aug 16, 2024
@jtschuster jtschuster added area-Tools-ILLink .NET linker development as well as trimming analyzers and removed untriaged New issue has not been triaged by the area owner needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 16, 2024
@jtschuster jtschuster added this to the Future milestone Aug 16, 2024
Copy link
Contributor

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas
See info in area-owners.md if you want to be subscribed.

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
Projects
Status: No status
Development

No branches or pull requests

1 participant