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')
-rw-r--r--test/Mono.Linker.Tests.Cases/DataFlow/GetTypeDataFlow.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/GetTypeDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/GetTypeDataFlow.cs
index dff625716..ef58eac31 100644
--- a/test/Mono.Linker.Tests.Cases/DataFlow/GetTypeDataFlow.cs
+++ b/test/Mono.Linker.Tests.Cases/DataFlow/GetTypeDataFlow.cs
@@ -34,6 +34,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow
TestStringEmpty ();
TypeWithWarnings.Test ();
+ OverConstTypeName.Test ();
// TODO:
// Test multi-value returns
@@ -163,7 +164,6 @@ namespace Mono.Linker.Tests.Cases.DataFlow
class TypeWithWarnings
{
-
[RequiresUnreferencedCode ("--Method1--")]
public void Method1 () { }
@@ -179,6 +179,21 @@ namespace Mono.Linker.Tests.Cases.DataFlow
}
}
+ class OverConstTypeName
+ {
+ private const string s_ConstTypeName = "Mono.Linker.Tests.Cases.DataFlow." + nameof (GetTypeDataFlow) + "+" + nameof (OverConstTypeName);
+
+ [RequiresUnreferencedCode ("--Method1--")]
+ public void Method1 () { }
+
+ // https://github.com/dotnet/linker/issues/2273
+ [ExpectedWarning ("IL2026", "--Method1--", ProducedBy = ProducedBy.Trimmer)]
+ public static void Test ()
+ {
+ Type.GetType (s_ConstTypeName).RequiresPublicMethods ();
+ }
+ }
+
[return: DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
private static string GetStringTypeWithPublicParameterlessConstructor ()
{