diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/Reflection/ConstructorUsedViaReflection.cs')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/Reflection/ConstructorUsedViaReflection.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Reflection/ConstructorUsedViaReflection.cs b/test/Mono.Linker.Tests.Cases/Reflection/ConstructorUsedViaReflection.cs new file mode 100644 index 000000000..16851b0cf --- /dev/null +++ b/test/Mono.Linker.Tests.Cases/Reflection/ConstructorUsedViaReflection.cs @@ -0,0 +1,34 @@ +using System; +using System.Reflection; +using Mono.Linker.Tests.Cases.Expectations.Assertions; + +namespace Mono.Linker.Tests.Cases.Reflection +{ + public class ConstructorUsedViaReflection { + public static void Main () + { + var constructor = typeof (OnlyUsedViaReflection).GetConstructor (BindingFlags.Public, null, new Type[]{}, new ParameterModifier[]{}); + constructor.Invoke (null, new object[] { }); + } + + [Kept] + private class OnlyUsedViaReflection { + [Kept] + public OnlyUsedViaReflection () + { } + + [Kept] + public OnlyUsedViaReflection(string bar) + { } + + private OnlyUsedViaReflection (int foo) + { } + + protected OnlyUsedViaReflection(int foo, int bar) + { } + + internal OnlyUsedViaReflection(int foo, int bar, int baz) + { } + } + } +} |