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

Add support for abstract static interface members #2058

Closed
8 tasks done
agocke opened this issue May 26, 2021 · 4 comments
Closed
8 tasks done

Add support for abstract static interface members #2058

agocke opened this issue May 26, 2021 · 4 comments
Assignees
Milestone

Comments

@agocke
Copy link
Member

agocke commented May 26, 2021

The linker shouldn't trim the interface definition when trimming in library mode, and we likely need to support the same implementation checks that we do for other interface members.

The minimum bar for .NET 6 is to ensure that runtime libraries are trim safe with this feature. The following check list tracks the tasks that are needed for the full support of this feature

  • Trimmer support for the IL changes. Specifically, the trimmer matches the runtime changes.
  • The runtime tests can be found here which contains tests in IL for TypeHierarchy, GenericContext, InterfaceVariance, and negative tests.
  • Add C# tests to the trimmer that tests this feature comprehensively (will require an updated compiler with the static interface support enabled)
  • Reflection support, specifically MakeGenericType and MakeGenericMethod.
  • Trimmer annotations are correctly propagated.
    • Validate DAM on type implementing static interface, or on interface type itself keeps interface members
    • Validate DAM on generic in interface method signature, or on interface type gets applied
    • Validate matching of DAM/RUC on interface method and implementing overrides
  • [ ] Investigate trimming of static interface methods when the interface is not used #2733 - potential improvement as this could reduce size
@agocke
Copy link
Member Author

agocke commented Jun 17, 2021

@LakshanF Has anything been finished here?

@LakshanF
Copy link
Member

The IL support

@agocke
Copy link
Member Author

agocke commented Apr 28, 2022

also @jtschuster who was looking at some of these problems. Looks like runtime is still hitting issues -- we should probably try to run the linker against dotnet/runtime#68612 directly and see if we can find and solve the problem

@jtschuster
Copy link
Member

I've confirmed that the linker removes all unused INumber<> interfaces in a hello world application.
cc @vitek-karas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants