diff options
author | Marek Safar <marek.safar@gmail.com> | 2021-05-08 09:26:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-08 09:26:38 +0300 |
commit | fafb6cf6a385a8c753faa174b9ab7c3600a9d494 (patch) | |
tree | 15df162f348d2c147acc2e7b9afc8ecd525beb78 /test/Mono.Linker.Tests.Cases/DataFlow | |
parent | a5f4931bc577ca94d05cd6b64e810c5cc4f035bb (diff) |
Trim parameter names metadata when they are not needed. (#1988)
Co-authored-by: Vitek Karas <vitek.karas@microsoft.com>
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/DataFlow')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs | 18 | ||||
-rw-r--r-- | test/Mono.Linker.Tests.Cases/DataFlow/MethodParametersDataFlow.cs | 1 |
2 files changed, 10 insertions, 9 deletions
diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs index b56225c9b..3889225a2 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs @@ -468,7 +468,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow typeof (T).RequiresNone (); } - [UnrecognizedReflectionAccessPattern (typeof (GenericParameterDataFlow), nameof (MethodRequiresPublicMethods) + "<T>()::T", messageCode: "IL2091")] + [UnrecognizedReflectionAccessPattern (typeof (GenericParameterDataFlow), nameof (MethodRequiresPublicMethods) + "<#1>()::T", messageCode: "IL2091")] static void MethodRequiresPublicFieldsPassThrough< [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] T> () { @@ -477,8 +477,8 @@ namespace Mono.Linker.Tests.Cases.DataFlow MethodRequiresNothing<T> (); } - [UnrecognizedReflectionAccessPattern (typeof (GenericParameterDataFlow), nameof (MethodRequiresPublicFields) + "<T>()::T", messageCode: "IL2091")] - [UnrecognizedReflectionAccessPattern (typeof (GenericParameterDataFlow), nameof (MethodRequiresPublicMethods) + "<T>()::T", messageCode: "IL2091")] + [UnrecognizedReflectionAccessPattern (typeof (GenericParameterDataFlow), nameof (MethodRequiresPublicFields) + "<#1>()::T", messageCode: "IL2091")] + [UnrecognizedReflectionAccessPattern (typeof (GenericParameterDataFlow), nameof (MethodRequiresPublicMethods) + "<#1>()::T", messageCode: "IL2091")] static void MethodRequiresNothingPassThrough<T> () { MethodRequiresPublicFields<T> (); @@ -550,7 +550,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow class TypeWithInstantiatedGenericMethodViaGenericParameter<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TOuter> : BaseTypeWithGenericMethod, IInterfaceWithGenericMethod { - [UnrecognizedReflectionAccessPattern (typeof (BaseTypeWithGenericMethod), nameof (BaseTypeWithGenericMethod.StaticRequiresPublicMethods) + "<T>()::T", + [UnrecognizedReflectionAccessPattern (typeof (BaseTypeWithGenericMethod), nameof (BaseTypeWithGenericMethod.StaticRequiresPublicMethods) + "<#1>()::T", messageCode: "IL2091", message: new string[] { "TInner", "Mono.Linker.Tests.Cases.DataFlow.GenericParameterDataFlow.TypeWithInstantiatedGenericMethodViaGenericParameter<TOuter>.StaticRequiresPublicFields<TInner>()", @@ -562,7 +562,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow StaticRequiresPublicMethods<TInner> (); } - [UnrecognizedReflectionAccessPattern (typeof (BaseTypeWithGenericMethod), nameof (BaseTypeWithGenericMethod.StaticRequiresPublicMethods) + "<T>()::T", + [UnrecognizedReflectionAccessPattern (typeof (BaseTypeWithGenericMethod), nameof (BaseTypeWithGenericMethod.StaticRequiresPublicMethods) + "<#1>()::T", messageCode: "IL2091", message: new string[] { "TOuter", "Mono.Linker.Tests.Cases.DataFlow.GenericParameterDataFlow.TypeWithInstantiatedGenericMethodViaGenericParameter<TOuter>", @@ -580,7 +580,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow StaticRequiresMultipleGenericParams<TOuter, TestType> (); } - [UnrecognizedReflectionAccessPattern (typeof (BaseTypeWithGenericMethod), nameof (BaseTypeWithGenericMethod.StaticRequiresMultipleGenericParams) + "<TFields,TMethods>()::TMethods", + [UnrecognizedReflectionAccessPattern (typeof (BaseTypeWithGenericMethod), nameof (BaseTypeWithGenericMethod.StaticRequiresMultipleGenericParams) + "<#2>()::TMethods", messageCode: "IL2091", message: new string[] { "TOuter", "Mono.Linker.Tests.Cases.DataFlow.GenericParameterDataFlow.TypeWithInstantiatedGenericMethodViaGenericParameter<TOuter>", @@ -591,7 +591,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow StaticRequiresMultipleGenericParams<TestType, TOuter> (); } - [UnrecognizedReflectionAccessPattern (typeof (BaseTypeWithGenericMethod), nameof (BaseTypeWithGenericMethod.InstanceRequiresPublicMethods) + "<T>()::T", + [UnrecognizedReflectionAccessPattern (typeof (BaseTypeWithGenericMethod), nameof (BaseTypeWithGenericMethod.InstanceRequiresPublicMethods) + "<#1>()::T", messageCode: "IL2091", message: new string[] { "TInner", "Mono.Linker.Tests.Cases.DataFlow.GenericParameterDataFlow.TypeWithInstantiatedGenericMethodViaGenericParameter<TOuter>.InstanceRequiresPublicFields<TInner>()", @@ -603,7 +603,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow InstanceRequiresPublicMethods<TInner> (); } - [UnrecognizedReflectionAccessPattern (typeof (BaseTypeWithGenericMethod), nameof (BaseTypeWithGenericMethod.InstanceRequiresPublicMethods) + "<T>()::T", + [UnrecognizedReflectionAccessPattern (typeof (BaseTypeWithGenericMethod), nameof (BaseTypeWithGenericMethod.InstanceRequiresPublicMethods) + "<#1>()::T", messageCode: "IL2091", message: new string[] { "TOuter", "Mono.Linker.Tests.Cases.DataFlow.GenericParameterDataFlow.TypeWithInstantiatedGenericMethodViaGenericParameter<TOuter>", @@ -639,7 +639,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow typeof (T).RequiresPublicMethods (); } - [UnrecognizedReflectionAccessPattern (typeof (IInterfaceWithGenericMethod), nameof (IInterfaceWithGenericMethod.InterfaceRequiresPublicMethods) + "<T>()::T", + [UnrecognizedReflectionAccessPattern (typeof (IInterfaceWithGenericMethod), nameof (IInterfaceWithGenericMethod.InterfaceRequiresPublicMethods) + "<#1>()::T", messageCode: "IL2091", message: new string[] { "TOuter", "Mono.Linker.Tests.Cases.DataFlow.GenericParameterDataFlow.TypeWithInstantiatedGenericMethodViaGenericParameter<TOuter>", diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/MethodParametersDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/MethodParametersDataFlow.cs index fe11b6b03..01047bc7a 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/MethodParametersDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/MethodParametersDataFlow.cs @@ -14,6 +14,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow // Note: this test's goal is to validate that the product correctly reports unrecognized patterns // - so the main validation is done by the UnrecognizedReflectionAccessPattern attributes. [SkipKeptItemsValidation] + [SetupLinkerArgument ("--keep-metadata", "parametername")] public class MethodParametersDataFlow { public static void Main () |