From 7b4fefea3c236cd4d5cdb880d7becd618f47feac Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Sat, 16 Nov 2019 21:36:43 +0100 Subject: [PATCH] Tests: Add nested generic constraint tests to GenericTypes --- Il2CppTests/TestSources/GenericTypes.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Il2CppTests/TestSources/GenericTypes.cs b/Il2CppTests/TestSources/GenericTypes.cs index 0abda70..a497acc 100644 --- a/Il2CppTests/TestSources/GenericTypes.cs +++ b/Il2CppTests/TestSources/GenericTypes.cs @@ -70,5 +70,21 @@ namespace Il2CppTests.TestSources // Added in C# 7.3 public void DelegateConstraint(D del) where D : Delegate {} public void EnumConstraint(E enumeration) where E : Enum {} + + // Nested types inherit parent constraints but should not be output + private class NestedWithAutomaticConstraints {} + + // Generates a compiler warning + //private class NestedWithDeclaringTypeGenericParameter {} + + private class NestedWithNewGenericParameter {} + + private class NestedWithNewGenericParameterAndConstraint where T : new() {} + + private class NestedWithNewGenericParameterAndDependentConstraint where T : G, new() {} + + private enum NestedEnumWithAutomaticConstraints {} + + private delegate void NestedDelegateWithAutomaticConstraints(); } } \ No newline at end of file