diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs index 09de0a015..1665c1abd 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs @@ -243,6 +243,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow static void TestBaseTypeGenericRequirements () { new DerivedTypeWithInstantiatedGenericOnBase (); + new DerivedTypeWithInstantiationOverSelfOnBase (); new DerivedTypeWithOpenGenericOnBase<TestType> (); new DerivedTypeWithOpenGenericOnBaseWithRequirements<TestType> (); } @@ -261,6 +262,15 @@ namespace Mono.Linker.Tests.Cases.DataFlow { } + class GenericBaseTypeWithRequiresAll<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.All)] T> + { + } + + [RecognizedReflectionAccessPattern] + class DerivedTypeWithInstantiationOverSelfOnBase : GenericBaseTypeWithRequirements<DerivedTypeWithInstantiationOverSelfOnBase> + { + } + [UnrecognizedReflectionAccessPattern (typeof (GenericBaseTypeWithRequirements<>), "T", messageCode: "IL2091")] class DerivedTypeWithOpenGenericOnBase<T> : GenericBaseTypeWithRequirements<T> { @@ -277,6 +287,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow static void TestInterfaceTypeGenericRequirements () { IGenericInterfaceTypeWithRequirements<TestType> instance = new InterfaceImplementationTypeWithInstantiatedGenericOnBase (); + new InterfaceImplementationTypeWithInstantiationOverSelfOnBase (); new InterfaceImplementationTypeWithOpenGenericOnBase<TestType> (); new InterfaceImplementationTypeWithOpenGenericOnBaseWithRequirements<TestType> (); } @@ -290,6 +301,15 @@ namespace Mono.Linker.Tests.Cases.DataFlow { } + interface IGenericInterfaceTypeWithRequiresAll<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.All)] T> + { + } + + [RecognizedReflectionAccessPattern] + class InterfaceImplementationTypeWithInstantiationOverSelfOnBase : IGenericInterfaceTypeWithRequiresAll<InterfaceImplementationTypeWithInstantiationOverSelfOnBase> + { + } + [UnrecognizedReflectionAccessPattern (typeof (IGenericInterfaceTypeWithRequirements<>), "T", messageCode: "IL2091")] class InterfaceImplementationTypeWithOpenGenericOnBase<T> : IGenericInterfaceTypeWithRequirements<T> { |