diff options
author | Jackson Schuster <36744439+jtschuster@users.noreply.github.com> | 2022-07-12 21:27:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 21:27:17 +0300 |
commit | e2b3a925b1ee6c55f9b95540647ce8362fe9ee44 (patch) | |
tree | 9125f3b7cbd5f32ef6dd723d6d05e8865d677665 /src | |
parent | 0872a5c7b6288746d287379dd391ff7d210e1801 (diff) |
Preserve all interfaces in library mode (#2886)
Diffstat (limited to 'src')
-rw-r--r-- | src/linker/Linker.Steps/RootAssemblyInputStep.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/linker/Linker.Steps/RootAssemblyInputStep.cs b/src/linker/Linker.Steps/RootAssemblyInputStep.cs index 87a4d4599..7e4d47b2c 100644 --- a/src/linker/Linker.Steps/RootAssemblyInputStep.cs +++ b/src/linker/Linker.Steps/RootAssemblyInputStep.cs @@ -143,6 +143,12 @@ namespace Mono.Linker.Steps if ((preserve & TypePreserveMembers.Internal) != 0 && IsTypePrivate (type)) preserve_anything &= ~TypePreserveMembers.Internal; + // Keep all interfaces and interface members in library mode + if ((preserve & TypePreserveMembers.Library) != 0 && type.IsInterface) { + Annotations.Mark (type, new DependencyInfo (DependencyKind.RootAssembly, type.Module.Assembly), new MessageOrigin (type.Module.Assembly)); + Annotations.SetPreserve (type, TypePreserve.All); + } + switch (preserve_anything) { case 0: return; |