From 5b33e3ad8f422d002ffe84700a0e51b976391f2b Mon Sep 17 00:00:00 2001 From: Vitek Karas <10670590+vitek-karas@users.noreply.github.com> Date: Fri, 7 Jan 2022 10:24:48 +0100 Subject: [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. --- test/Mono.Linker.Tests.Cases/DataFlow/TypeBaseTypeDataFlow.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/Mono.Linker.Tests.Cases/DataFlow') 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)); @@ -164,6 +166,12 @@ namespace Mono.Linker.Tests.Cases.DataFlow derivedType.BaseType.RequiresNonPublicProperties (); } + [RecognizedReflectionAccessPattern] + static void TestInterfacesPropagated ([DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.Interfaces)] Type derivedType) + { + derivedType.BaseType.RequiresInterfaces (); + } + [RecognizedReflectionAccessPattern] static void TestCombinationOfPublicsIsPropagated ( [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicProperties)] Type derivedType) -- cgit v1.2.3