diff options
author | Vitek Karas <10670590+vitek-karas@users.noreply.github.com> | 2022-01-07 12:24:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-07 12:24:48 +0300 |
commit | 5b33e3ad8f422d002ffe84700a0e51b976391f2b (patch) | |
tree | 68a4ac142821f83ca2074bd273324bcfa5cf5a8d /test/Mono.Linker.Tests.Cases/DataFlow | |
parent | e28b7f3f306bb410a8a1a2f4b80f413fdea4ce86 (diff) |
[release/6.0.2xx] Propagate Interfaces annotation through Type.BaseType (#2476)
The Interfaces annotation makes sure the type has all interfaces, meaning `GetInterfaces` reflection call will work on it. That means that all interfaces of the base type are also preserved, so the `Interfaces` annotation should be propagated to the base type as well.
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/DataFlow')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/DataFlow/TypeBaseTypeDataFlow.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/TypeBaseTypeDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/TypeBaseTypeDataFlow.cs index abe5aaada..68d232252 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/TypeBaseTypeDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/TypeBaseTypeDataFlow.cs @@ -34,6 +34,8 @@ namespace Mono.Linker.Tests.Cases.DataFlow TestNonPublicNestedTypesAreNotPropagated (typeof (TestType)); TestNonPublicPropertiesAreNotPropagated (typeof (TestType)); + TestInterfacesPropagated (typeof (TestType)); + TestCombinationOfPublicsIsPropagated (typeof (TestType)); TestCombinationOfNonPublicsIsNotPropagated (typeof (TestType)); TestCombinationOfPublicAndNonPublicsPropagatesPublicOnly (typeof (TestType)); @@ -165,6 +167,12 @@ namespace Mono.Linker.Tests.Cases.DataFlow } [RecognizedReflectionAccessPattern] + static void TestInterfacesPropagated ([DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.Interfaces)] Type derivedType) + { + derivedType.BaseType.RequiresInterfaces (); + } + + [RecognizedReflectionAccessPattern] static void TestCombinationOfPublicsIsPropagated ( [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicProperties)] Type derivedType) { |