镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Missing cases in base/override method comparisons #5974

Closed

Description

@sbomer

I'm filing this issue to track concerns that came up in #5748 (comment). See that discussion for more context. The basic issue is that some base/override method comparisons don't account for the .override directive or variance of parameters.

PreserveRegistrations calls the helper TryGetBaseOrInterfaceRegisterMember to look for matching base methods:

https://github.com/xamarin/xamarin-android/blob/da536fcf1b663fd71adee40c06466547a04cc6ed/src/Microsoft.Android.Sdk.ILLink/PreserveRegistrations.cs#L87

It is also called from MonoDroidMarkStep, but I haven't looked into this usage.

There are a few potential issues along the lines that @jonpryor mentioned in #5748 (comment), but I don't have the full context to understand how concerning these are:

Compare this with FixAbstractMethodsStep:
https://github.com/xamarin/xamarin-android/blob/da536fcf1b663fd71adee40c06466547a04cc6ed/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixAbstractMethodsStep.cs#L228-L232
which does check for overrides
https://github.com/xamarin/xamarin-android/blob/da536fcf1b663fd71adee40c06466547a04cc6ed/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixAbstractMethodsStep.cs#L172-L175

https://github.com/xamarin/xamarin-android/blob/da536fcf1b663fd71adee40c06466547a04cc6ed/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixAbstractMethodsStep.cs#L160-L169

though I don't think it does anything to handle variance.

Long-term I think the ideal approach would be to build these kinds of comparisons into the linker and make the APIs available to custom steps. There may be more cases that need to be considered, such as default interface methods, and static virtual interface methods.

Activity

  1. added
    Area: TrimmingIssues with ILLink or NativeAOT related to trimming.
    and removed
    needs-triageIssues that need to be assigned.
    on May 28, 2021
  2. assigned and unassigned on May 28, 2021
  3. dotnet-policy-service commented on Aug 13, 2026

    @dotnet-policy-service

    We suspect this issue is stale and no longer relevant. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

  4. dotnet-policy-service commented on Aug 27, 2026

    @dotnet-policy-service

    This issue will now be closed since it had been marked "possibly-stale" but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

  5. locked and limited conversation to collaborators on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: TrimmingIssues with ILLink or NativeAOT related to trimming.possibly-staleIssues that are potentially no longer relevant.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions