You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mark most specific static DIM for types marked RelevantToVariantCasting (#97487)
Previously, we weren't handling static DIMs to ensure that DIMs that provided an implementation of an interface method for an inheriting type would be kept.
This method gets rid of _interfaceOverrides and uses _virtual_methods with TypeMapInfo to find all interface method / implementation pairs.
This PR adds static method handling to the ProcessDefaultImplementation method where it previously only handled instance interface methods. It assumes all static interface methods will be needed if the type implementing the interface IsRelevantToVariantCasting.
The DIM cache also is updated to include the method that provides the implementation for a type.
/// Returns true if the override method is required due to the interface that the base method is declared on. See doc at <see href="docs/methods-kept-by-interface.md"/> for explanation of logic.
Copy file name to clipboardExpand all lines: src/tools/illink/src/linker/Linker/Annotations.cs
+11-3Lines changed: 11 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -447,22 +447,30 @@ public bool IsPublic (IMetadataTokenProvider provider)
447
447
}
448
448
449
449
/// <summary>
450
-
/// Returns a list of all known methods that override <paramref name="method"/>. The list may be incomplete if other overrides exist in assemblies that haven't been processed by TypeMapInfo yet
450
+
/// Returns a list of all known methods that override <paramref name="method"/>.
451
+
/// The list may be incomplete if other overrides exist in assemblies that haven't been processed by TypeMapInfo yet
/// Returns all base methods that <paramref name="method"/> overrides.
464
472
/// This includes methods on <paramref name="method"/>'s declaring type's base type (but not methods higher up in the type hierarchy),
465
-
/// methods on an interface that <paramref name="method"/>'s delcaring type implements,
473
+
/// methods on an interface that <paramref name="method"/>'s declaring type implements,
466
474
/// and methods an interface implemented by a derived type of <paramref name="method"/>'s declaring type if the derived type uses <paramref name="method"/> as the implementing method.
467
475
/// The list may be incomplete if there are derived types in assemblies that havent been processed yet that use <paramref name="method"/> to implement an interface.
Copy file name to clipboardExpand all lines: src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Inheritance.Interfaces.DefaultInterfaceMethodsTests.g.cs
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -27,12 +27,30 @@ public Task InterfaceWithAttributeOnImplementation ()
0 commit comments