Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/DataFlow')
-rw-r--r--test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs20
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 a765e85aa..1e2313f2a 100644
--- a/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs
+++ b/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs
@@ -764,7 +764,9 @@ namespace Mono.Linker.Tests.Cases.DataFlow
TestWithRequirements ();
TestWithRequirementsFromParam (null);
+ TestWithRequirementsFromParamWithMismatch (null);
TestWithRequirementsFromGenericParam<TestType> ();
+ TestWithRequirementsFromGenericParamWithMismatch<TestType> ();
TestWithNoRequirements ();
TestWithNoRequirementsFromParam (null);
@@ -843,6 +845,15 @@ namespace Mono.Linker.Tests.Cases.DataFlow
typeof (GenericWithPublicFieldsArgument<>).MakeGenericType (type);
}
+ // https://github.com/dotnet/linker/issues/2428
+ // [ExpectedWarning ("IL2071", "'T'")]
+ [ExpectedWarning ("IL2070", "'this'")]
+ static void TestWithRequirementsFromParamWithMismatch (
+ [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] Type type)
+ {
+ typeof (GenericWithPublicFieldsArgument<>).MakeGenericType (type);
+ }
+
[RecognizedReflectionAccessPattern]
static void TestWithRequirementsFromGenericParam<
[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] T> ()
@@ -850,6 +861,15 @@ namespace Mono.Linker.Tests.Cases.DataFlow
typeof (GenericWithPublicFieldsArgument<>).MakeGenericType (typeof (T));
}
+ // https://github.com/dotnet/linker/issues/2428
+ // [ExpectedWarning ("IL2091", "'T'")]
+ [ExpectedWarning ("IL2090", "'this'")] // Note that this actually produces a warning which should not be possible to produce right now
+ static void TestWithRequirementsFromGenericParamWithMismatch<
+ [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TInput> ()
+ {
+ typeof (GenericWithPublicFieldsArgument<>).MakeGenericType (typeof (TInput));
+ }
+
class GenericWithPublicFieldsArgument<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] T>
{
}