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
This will make sure that we keep all interfaces and all interface method implementations on such type.
* Change the solution to rely on the optimization setting only
* wip
* Add implicit interface implementation case
* Edit tests to remove issue-specific code and names
* Mark members of CollectedType as kept
* Add private interface test and simplify external interface example
* Replace early exit for non-interfaces
* License headers and use IsMethodNeededByTypeDueToPreservedScope instead of Interface specific version
* Add check for static methods before skipping virtual marking
Check for optimization before skipping marking interface methods for
PreservedScope
Add doc comments
* Add more clarifying comments, move static method check, rename method
Rename IsVirtualNeededByInstantiatedTypeDueToPreservedScope to IsOverrideNeededByInstantiatedTypeDueToPreservedScope
Added more comments describing purpose of methods
Moved the static interface method check to the method that is called on all types regardless of instantiation
* Renames and comment cleanup + tests
This doesn't change product behavior, only renamed methods and improved comments.
Added new tests for the RootLibrary:
- Added a dependency to an "copy" assembly (mainly because I can define a static interface in it)
- Added more combinations to the interfaces/classes in the test
- Since this uses static interface methods I had to enable "preview" language features for the test project and for the test infra.
* More tests for interface behavior
Co-authored-by: vitek-karas <vitek.karas@microsoft.com>
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
Commit migrated from dotnet/linker@8c33ad3
/// Returns true if any of the base methods of the <paramref name="method"/> passed is in an assembly that is not trimmed (i.e. action != trim).
2291
+
/// Meant to be used to determine whether methods should be marked regardless of whether it is instantiated or not.
2292
+
/// </summary>
2293
+
/// <remarks>
2294
+
/// When the unusedinterfaces optimization is on, this is used to mark methods that override an abstract method from a non-link assembly and must be kept.
2295
+
/// When the unusedinterfaces optimization is off, this will do the same as when on but will also mark interface methods from interfaces defined in a non-link assembly.
2296
+
/// If the containing type is instantiated, the caller should also use <see cref="IsMethodNeededByInstantiatedTypeDueToPreservedScope (MethodDefinition)" />
/// Returns true if any of the base methods of <paramref name="method" /> is defined in an assembly that is not trimmed (i.e. action!=trim).
2332
+
/// This is meant to be used on methods from a type that is known to be instantiated.
2333
+
/// </summary>
2334
+
/// <remarks>
2335
+
/// This is very similar to <see cref="IsMethodNeededByTypeDueToPreservedScope (MethodDefinition)"/>,
2336
+
/// but will mark methods from an interface defined in a non-link assembly regardless of the optimization, and does not handle static interface methods.
// Any static interface methods are captured by <see cref="IsVirtualNeededByTypeDueToPreservedScope">, which should be called on all relevant methods so no need to check again here.
Copy file name to clipboardExpand all lines: src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Inheritance.InterfacesTests.g.cs
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -21,5 +21,11 @@ public Task InterfaceOnUninstantiatedTypeRemoved ()
Copy file name to clipboardExpand all lines: src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/InterfaceOnUninstantiatedTypeRemoved.cs
0 commit comments