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:
authorvitek-karas <vitek.karas@microsoft.com>2019-11-29 16:13:31 +0300
committerMarek Safar <marek.safar@gmail.com>2019-11-29 17:33:02 +0300
commitcf0087516e9f15bb880938aec5223598d0676007 (patch)
treebc0b87745f08f9000755be85b5d2dc144eee6f42
parent26cb3b8653c0bc3a7ebd85c4794d99f553e36619 (diff)
Add a simple test for typeof(type)
-rw-r--r--test/Mono.Linker.Tests.Cases/Reflection/TypeUsedViaReflection.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Reflection/TypeUsedViaReflection.cs b/test/Mono.Linker.Tests.Cases/Reflection/TypeUsedViaReflection.cs
index 07a01b1ae..1937b971a 100644
--- a/test/Mono.Linker.Tests.Cases/Reflection/TypeUsedViaReflection.cs
+++ b/test/Mono.Linker.Tests.Cases/Reflection/TypeUsedViaReflection.cs
@@ -1,6 +1,4 @@
using System;
-using System.Diagnostics;
-using System.Reflection;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
namespace Mono.Linker.Tests.Cases.Reflection {
@@ -22,6 +20,7 @@ namespace Mono.Linker.Tests.Cases.Reflection {
TestMultiDimensionalArrayFullString ();
TestMultiDimensionalArrayAsmName ();
TestDeeplyNested ();
+ TestTypeOf ();
}
[Kept]
@@ -174,5 +173,14 @@ namespace Mono.Linker.Tests.Cases.Reflection {
{
var typeKept = Type.GetType ("Mono.Linker.Tests.Cases.Reflection.TypeUsedViaReflection+Nested1+N2+N3");
}
+
+ [Kept]
+ class TypeOfToKeep { }
+
+ [Kept]
+ static void TestTypeOf()
+ {
+ var typeKept = typeof(TypeOfToKeep);
+ }
}
}