diff --git a/Il2CppTests/TestExpectedResults/ArraysAndPointers.cs b/Il2CppTests/TestExpectedResults/ArraysAndPointers.cs index a0f6bcb..3969643 100644 --- a/Il2CppTests/TestExpectedResults/ArraysAndPointers.cs +++ b/Il2CppTests/TestExpectedResults/ArraysAndPointers.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x003EE220 public static string GetText(string fmt, params /* 0x000A50D8 */ object[] args); // 0x003EE224 + } @@ -108,6 +109,7 @@ internal class Test // TypeDefIndex: 1813 public unsafe delegate void OnUnsafe(int* ud); // TypeDefIndex: 1816; 0x00562F3C public class NestedUnsafe // TypeDefIndex: 1817 + where T : struct { // Constructors public NestedUnsafe(); @@ -115,6 +117,7 @@ internal class Test // TypeDefIndex: 1813 // Methods private unsafe T* UnsafeGenericReturn(); private unsafe void UnsafeGenericMethod(T* pt); + } // Constructors @@ -126,5 +129,6 @@ internal class Test // TypeDefIndex: 1813 public unsafe void UnsafeMethod(int* unsafePointerArgument); // 0x00562EFC public unsafe int* UnsafeReturnMethod(); // 0x00562F00 public unsafe int* UnsafeMethod2(int* i); // 0x00562F08 + } diff --git a/Il2CppTests/TestExpectedResults/CustomAttributeData.cs b/Il2CppTests/TestExpectedResults/CustomAttributeData.cs index e8ee7a8..7dedf92 100644 --- a/Il2CppTests/TestExpectedResults/CustomAttributeData.cs +++ b/Il2CppTests/TestExpectedResults/CustomAttributeData.cs @@ -73,6 +73,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x003EC708 public static string GetText(string fmt, params /* 0x000A35A8 */ object[] args); // 0x003EC70C + } @@ -118,5 +119,6 @@ public class Test // TypeDefIndex: 1813 // Methods [Example] // 0x000A5208 public void TestMethod([Example] /* 0x000A525C */ object arg); // 0x0056132C + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x64.cs b/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x64.cs index a057aa1..b0dfefb 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x64.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x64.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x0000000180123590 public static string GetText(string fmt, params /* 0x00000001800090A0 */ object[] args); // 0x00000001802C64F0 + } @@ -108,6 +109,7 @@ internal class Test // TypeDefIndex: 1813 public unsafe delegate void OnUnsafe(int* ud); // TypeDefIndex: 1816; 0x00000001803E0E50 public class NestedUnsafe // TypeDefIndex: 1817 + where T : struct { // Constructors public NestedUnsafe(); @@ -115,6 +117,7 @@ internal class Test // TypeDefIndex: 1813 // Methods private unsafe T* UnsafeGenericReturn(); private unsafe void UnsafeGenericMethod(T* pt); + } // Constructors @@ -126,5 +129,6 @@ internal class Test // TypeDefIndex: 1813 public unsafe void UnsafeMethod(int* unsafePointerArgument); // 0x00000001800EA7B0 public unsafe int* UnsafeReturnMethod(); // 0x00000001800EA8C0 public unsafe int* UnsafeMethod2(int* i); // 0x000000018012FC60 + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x86.cs b/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x86.cs index 1846633..9bb9799 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x86.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-ArraysAndPointers-x86.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x100F7810 public static string GetText(string fmt, params /* 0x10009AA0 */ object[] args); // 0x10261460 + } @@ -108,6 +109,7 @@ internal class Test // TypeDefIndex: 1813 public unsafe delegate void OnUnsafe(int* ud); // TypeDefIndex: 1816; 0x1034DA60 public class NestedUnsafe // TypeDefIndex: 1817 + where T : struct { // Constructors public NestedUnsafe(); @@ -115,6 +117,7 @@ internal class Test // TypeDefIndex: 1813 // Methods private unsafe T* UnsafeGenericReturn(); private unsafe void UnsafeGenericMethod(T* pt); + } // Constructors @@ -126,5 +129,6 @@ internal class Test // TypeDefIndex: 1813 public unsafe void UnsafeMethod(int* unsafePointerArgument); // 0x100C5530 public unsafe int* UnsafeReturnMethod(); // 0x100C5600 public unsafe int* UnsafeMethod2(int* i); // 0x10102390 + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x64.cs b/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x64.cs index 28b8b15..ae4bb16 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x64.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x64.cs @@ -73,6 +73,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x0000000180123590 public static string GetText(string fmt, params /* 0x0000000180009150 */ object[] args); // 0x00000001802C64F0 + } @@ -118,5 +119,6 @@ public class Test // TypeDefIndex: 1813 // Methods [Example] // 0x000000018000C710 public void TestMethod([Example] /* 0x000000018000C750 */ object arg); // 0x00000001800EA7B0 + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x86.cs b/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x86.cs index 1ba7c04..c7b5279 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x86.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-CustomAttributeData-x86.cs @@ -73,6 +73,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x100F7810 public static string GetText(string fmt, params /* 0x10009B80 */ object[] args); // 0x10261460 + } @@ -118,5 +119,6 @@ public class Test // TypeDefIndex: 1813 // Methods [Example] // 0x1000D550 public void TestMethod([Example] /* 0x1000D590 */ object arg); // 0x100C5530 + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x64.cs b/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x64.cs index 161ecca..21001d2 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x64.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x64.cs @@ -1,30 +1,30 @@ // Image 0: mscorlib.dll - 0 -[assembly: AssemblyCompany] // 0x000000018000E950 -[assembly: AssemblyCopyright] // 0x000000018000E950 -[assembly: AssemblyDefaultAlias] // 0x000000018000E950 -[assembly: AssemblyDelaySign] // 0x000000018000E950 -[assembly: AssemblyDescription] // 0x000000018000E950 -[assembly: AssemblyFileVersion] // 0x000000018000E950 -[assembly: AssemblyInformationalVersion] // 0x000000018000E950 -[assembly: AssemblyKeyFile] // 0x000000018000E950 -[assembly: AssemblyProduct] // 0x000000018000E950 -[assembly: AssemblyTitle] // 0x000000018000E950 -[assembly: CLSCompliant] // 0x000000018000E950 -[assembly: CompilationRelaxations] // 0x000000018000E950 -[assembly: ComVisible] // 0x000000018000E950 -[assembly: Debuggable] // 0x000000018000E950 -[assembly: DefaultDependency] // 0x000000018000E950 -[assembly: Guid] // 0x000000018000E950 -[assembly: NeutralResourcesLanguage] // 0x000000018000E950 -[assembly: RuntimeCompatibility] // 0x000000018000E950 -[assembly: SatelliteContractVersion] // 0x000000018000E950 -[assembly: StringFreezing] // 0x000000018000E950 -[assembly: TypeLibVersion] // 0x000000018000E950 +[assembly: AssemblyCompany] // 0x000000018000E050 +[assembly: AssemblyCopyright] // 0x000000018000E050 +[assembly: AssemblyDefaultAlias] // 0x000000018000E050 +[assembly: AssemblyDelaySign] // 0x000000018000E050 +[assembly: AssemblyDescription] // 0x000000018000E050 +[assembly: AssemblyFileVersion] // 0x000000018000E050 +[assembly: AssemblyInformationalVersion] // 0x000000018000E050 +[assembly: AssemblyKeyFile] // 0x000000018000E050 +[assembly: AssemblyProduct] // 0x000000018000E050 +[assembly: AssemblyTitle] // 0x000000018000E050 +[assembly: CLSCompliant] // 0x000000018000E050 +[assembly: CompilationRelaxations] // 0x000000018000E050 +[assembly: ComVisible] // 0x000000018000E050 +[assembly: Debuggable] // 0x000000018000E050 +[assembly: DefaultDependency] // 0x000000018000E050 +[assembly: Guid] // 0x000000018000E050 +[assembly: NeutralResourcesLanguage] // 0x000000018000E050 +[assembly: RuntimeCompatibility] // 0x000000018000E050 +[assembly: SatelliteContractVersion] // 0x000000018000E050 +[assembly: StringFreezing] // 0x000000018000E050 +[assembly: TypeLibVersion] // 0x000000018000E050 // Image 1: GenericTypes.dll - 1810 -[assembly: CompilationRelaxations] // 0x000000018000CAF0 -[assembly: Debuggable] // 0x000000018000CAF0 -[assembly: RuntimeCompatibility] // 0x000000018000CAF0 +[assembly: CompilationRelaxations] // 0x000000018000C150 +[assembly: Debuggable] // 0x000000018000C150 +[assembly: RuntimeCompatibility] // 0x000000018000C150 // Namespace: @@ -71,12 +71,14 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x0000000180123590 - public static string GetText(string fmt, params /* 0x0000000180009C10 */ object[] args); // 0x00000001802C64F0 + public static string GetText(string fmt, params /* 0x00000001800090D0 */ object[] args); // 0x00000001802C64F0 + } + // Namespace: Il2CppTests.TestSources -public class Base // TypeDefIndex: 1811 +public class Base // TypeDefIndex: 1815 { // Constructors public Base(); @@ -84,13 +86,13 @@ public class Base // TypeDefIndex: 1811 } // Namespace: Il2CppTests.TestSources -public class Derived : Base // TypeDefIndex: 1812 +public class Derived : Base // TypeDefIndex: 1816 { // Fields public G> F; // 0x00 // Nested types - public class Nested // TypeDefIndex: 1813 + public class Nested // TypeDefIndex: 1817 { // Constructors public Nested(); @@ -103,7 +105,7 @@ public class Derived : Base // TypeDefIndex: 1812 } // Namespace: Il2CppTests.TestSources -public class G // TypeDefIndex: 1814 +public class G // TypeDefIndex: 1818 { // Constructors public G(); @@ -111,12 +113,46 @@ public class G // TypeDefIndex: 1814 } // Namespace: Il2CppTests.TestSources -internal class Test // TypeDefIndex: 1815 +internal class Test // TypeDefIndex: 1819 { // Constructors public Test(); // 0x00000001800E2000 // Methods - public void GenericTypesTest(); // 0x00000001803E0E50 + public void GenericTypesTest(); // 0x00000001803E0ED0 + +} + +// Namespace: Il2CppTests.TestSources +internal class ConstrainedValueType // TypeDefIndex: 1820 + where V : struct +{ + // Constructors + public ConstrainedValueType(); + +} + +// Namespace: Il2CppTests.TestSources +internal class ConstrainedRefType // TypeDefIndex: 1821 + where R : class +{ + // Constructors + public ConstrainedRefType(); + + // Methods + [NullableContext] // 0x0000000180009190 + public void ConstrainedMethodNotNull(N notnullArgument, R bar); + public void ConstrainedUnmanaged(U unmanagedArgument) + where U : struct; + public void MultipleConstraintsMethod(C constrained) + where C : R, new(); + public void MultipleArgumentsMultipleConstraintsMethod(B baseArgument, I interfaceArgument) + where B : Derived, new() + where I : Test, IDisposable, IEnumerable; + public void DelegateConstraint(D del) + where D : Delegate; + public void EnumConstraint(E enumeration) + where E : Enum; + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x86.cs b/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x86.cs index 96d5187..966ec37 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x86.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-GenericTypes-x86.cs @@ -1,30 +1,30 @@ // Image 0: mscorlib.dll - 0 -[assembly: AssemblyCompany] // 0x1000F760 -[assembly: AssemblyCopyright] // 0x1000F760 -[assembly: AssemblyDefaultAlias] // 0x1000F760 -[assembly: AssemblyDelaySign] // 0x1000F760 -[assembly: AssemblyDescription] // 0x1000F760 -[assembly: AssemblyFileVersion] // 0x1000F760 -[assembly: AssemblyInformationalVersion] // 0x1000F760 -[assembly: AssemblyKeyFile] // 0x1000F760 -[assembly: AssemblyProduct] // 0x1000F760 -[assembly: AssemblyTitle] // 0x1000F760 -[assembly: CLSCompliant] // 0x1000F760 -[assembly: CompilationRelaxations] // 0x1000F760 -[assembly: ComVisible] // 0x1000F760 -[assembly: Debuggable] // 0x1000F760 -[assembly: DefaultDependency] // 0x1000F760 -[assembly: Guid] // 0x1000F760 -[assembly: NeutralResourcesLanguage] // 0x1000F760 -[assembly: RuntimeCompatibility] // 0x1000F760 -[assembly: SatelliteContractVersion] // 0x1000F760 -[assembly: StringFreezing] // 0x1000F760 -[assembly: TypeLibVersion] // 0x1000F760 +[assembly: AssemblyCompany] // 0x1000ED00 +[assembly: AssemblyCopyright] // 0x1000ED00 +[assembly: AssemblyDefaultAlias] // 0x1000ED00 +[assembly: AssemblyDelaySign] // 0x1000ED00 +[assembly: AssemblyDescription] // 0x1000ED00 +[assembly: AssemblyFileVersion] // 0x1000ED00 +[assembly: AssemblyInformationalVersion] // 0x1000ED00 +[assembly: AssemblyKeyFile] // 0x1000ED00 +[assembly: AssemblyProduct] // 0x1000ED00 +[assembly: AssemblyTitle] // 0x1000ED00 +[assembly: CLSCompliant] // 0x1000ED00 +[assembly: CompilationRelaxations] // 0x1000ED00 +[assembly: ComVisible] // 0x1000ED00 +[assembly: Debuggable] // 0x1000ED00 +[assembly: DefaultDependency] // 0x1000ED00 +[assembly: Guid] // 0x1000ED00 +[assembly: NeutralResourcesLanguage] // 0x1000ED00 +[assembly: RuntimeCompatibility] // 0x1000ED00 +[assembly: SatelliteContractVersion] // 0x1000ED00 +[assembly: StringFreezing] // 0x1000ED00 +[assembly: TypeLibVersion] // 0x1000ED00 // Image 1: GenericTypes.dll - 1810 -[assembly: CompilationRelaxations] // 0x1000DC90 -[assembly: Debuggable] // 0x1000DC90 -[assembly: RuntimeCompatibility] // 0x1000DC90 +[assembly: CompilationRelaxations] // 0x1000D1B0 +[assembly: Debuggable] // 0x1000D1B0 +[assembly: RuntimeCompatibility] // 0x1000D1B0 // Namespace: @@ -71,12 +71,14 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x100F7810 - public static string GetText(string fmt, params /* 0x1000A660 */ object[] args); // 0x10261460 + public static string GetText(string fmt, params /* 0x10009B20 */ object[] args); // 0x10261460 + } + // Namespace: Il2CppTests.TestSources -public class Base // TypeDefIndex: 1811 +public class Base // TypeDefIndex: 1815 { // Constructors public Base(); @@ -84,13 +86,13 @@ public class Base // TypeDefIndex: 1811 } // Namespace: Il2CppTests.TestSources -public class Derived : Base // TypeDefIndex: 1812 +public class Derived : Base // TypeDefIndex: 1816 { // Fields public G> F; // 0x00 // Nested types - public class Nested // TypeDefIndex: 1813 + public class Nested // TypeDefIndex: 1817 { // Constructors public Nested(); @@ -103,7 +105,7 @@ public class Derived : Base // TypeDefIndex: 1812 } // Namespace: Il2CppTests.TestSources -public class G // TypeDefIndex: 1814 +public class G // TypeDefIndex: 1818 { // Constructors public G(); @@ -111,12 +113,46 @@ public class G // TypeDefIndex: 1814 } // Namespace: Il2CppTests.TestSources -internal class Test // TypeDefIndex: 1815 +internal class Test // TypeDefIndex: 1819 { // Constructors public Test(); // 0x100BF000 // Methods - public void GenericTypesTest(); // 0x1034DA60 + public void GenericTypesTest(); // 0x1034DB10 + +} + +// Namespace: Il2CppTests.TestSources +internal class ConstrainedValueType // TypeDefIndex: 1820 + where V : struct +{ + // Constructors + public ConstrainedValueType(); + +} + +// Namespace: Il2CppTests.TestSources +internal class ConstrainedRefType // TypeDefIndex: 1821 + where R : class +{ + // Constructors + public ConstrainedRefType(); + + // Methods + [NullableContext] // 0x10009AA0 + public void ConstrainedMethodNotNull(N notnullArgument, R bar); + public void ConstrainedUnmanaged(U unmanagedArgument) + where U : struct; + public void MultipleConstraintsMethod(C constrained) + where C : R, new(); + public void MultipleArgumentsMultipleConstraintsMethod(B baseArgument, I interfaceArgument) + where B : Derived, new() + where I : Test, IDisposable, IEnumerable; + public void DelegateConstraint(D del) + where D : Delegate; + public void EnumConstraint(E enumeration) + where E : Enum; + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-Methods-x64.cs b/Il2CppTests/TestExpectedResults/GameAssembly-Methods-x64.cs index 4f230c0..e083ab1 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-Methods-x64.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-Methods-x64.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x0000000180123590 public static string GetText(string fmt, params /* 0x0000000180009C10 */ object[] args); // 0x00000001802C64F0 + } @@ -85,6 +86,7 @@ internal class Test // TypeDefIndex: 1811 public virtual void VirtualMethod(); // 0x00000001800EA7B0 public double ValueTypeReturnMethod(); // 0x00000001803E0EC0 public StringBuilder ReferenceTypeReturnMethod(); // 0x00000001803E0E70 + } // Namespace: Il2CppTests.TestSources @@ -92,6 +94,7 @@ public static class TestExtension // TypeDefIndex: 1812 { // Methods public static double DivideByXExtension(int a, float x); // 0x00000001803E0E50 + } // Namespace: Il2CppTests.TestSources @@ -102,6 +105,7 @@ internal abstract class TestAbstract // TypeDefIndex: 1813 // Methods public abstract void AbstractMethod(); + } // Namespace: Il2CppTests.TestSources @@ -112,6 +116,7 @@ internal class TestOverride : Test // TypeDefIndex: 1814 // Methods public override void VirtualMethod(); // 0x00000001800EA7B0 + } // Namespace: Il2CppTests.TestSources @@ -122,6 +127,7 @@ internal class TestHideVirtual : Test // TypeDefIndex: 1815 // Methods public new void VirtualMethod(); // 0x00000001800EA7B0 + } // Namespace: Il2CppTests.TestSources @@ -132,6 +138,7 @@ internal class TestHideOverride : TestOverride // TypeDefIndex: 1816 // Methods public new void VirtualMethod(); // 0x00000001800EA7B0 + } // Namespace: Il2CppTests.TestSources @@ -142,6 +149,7 @@ internal class TestOverrideAbstract : TestAbstract // TypeDefIndex: 1817 // Methods public override void AbstractMethod(); // 0x00000001800EA7B0 + } // Namespace: Il2CppTests.TestSources @@ -152,6 +160,7 @@ internal class TestHideAbstractOverride : TestOverrideAbstract // TypeDefIndex: // Methods public new void AbstractMethod(); // 0x00000001800EA7B0 + } // Namespace: Il2CppTests.TestSources @@ -162,6 +171,7 @@ internal class TestHideVirtualAndNewVirtual : Test // TypeDefIndex: 1819 // Methods public virtual new void VirtualMethod(); // 0x00000001800EA7B0 + } // Namespace: Il2CppTests.TestSources @@ -172,6 +182,7 @@ internal class TestHideOverrideAndNewVirtual : TestOverride // TypeDefIndex: 182 // Methods public virtual new void VirtualMethod(); // 0x00000001800EA7B0 + } // Namespace: Il2CppTests.TestSources @@ -182,6 +193,7 @@ internal abstract class TestAbstractNew : TestOverride // TypeDefIndex: 1821 // Methods public abstract new void VirtualMethod(); + } // Namespace: Il2CppTests.TestSources @@ -192,5 +204,6 @@ internal class TestNewNonVirtualMethod : Test // TypeDefIndex: 1822 // Methods public int ValueTypeReturnMethod(); // 0x0000000180119A50 + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-Methods-x86.cs b/Il2CppTests/TestExpectedResults/GameAssembly-Methods-x86.cs index bc3a3fa..241c4af 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-Methods-x86.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-Methods-x86.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x100F7810 public static string GetText(string fmt, params /* 0x1000A660 */ object[] args); // 0x10261460 + } @@ -85,6 +86,7 @@ internal class Test // TypeDefIndex: 1811 public virtual void VirtualMethod(); // 0x100C5530 public double ValueTypeReturnMethod(); // 0x1034DAD0 public StringBuilder ReferenceTypeReturnMethod(); // 0x1034DA90 + } // Namespace: Il2CppTests.TestSources @@ -92,6 +94,7 @@ public static class TestExtension // TypeDefIndex: 1812 { // Methods public static double DivideByXExtension(int a, float x); // 0x1034DA60 + } // Namespace: Il2CppTests.TestSources @@ -102,6 +105,7 @@ internal abstract class TestAbstract // TypeDefIndex: 1813 // Methods public abstract void AbstractMethod(); + } // Namespace: Il2CppTests.TestSources @@ -112,6 +116,7 @@ internal class TestOverride : Test // TypeDefIndex: 1814 // Methods public override void VirtualMethod(); // 0x100C5530 + } // Namespace: Il2CppTests.TestSources @@ -122,6 +127,7 @@ internal class TestHideVirtual : Test // TypeDefIndex: 1815 // Methods public new void VirtualMethod(); // 0x100C5530 + } // Namespace: Il2CppTests.TestSources @@ -132,6 +138,7 @@ internal class TestHideOverride : TestOverride // TypeDefIndex: 1816 // Methods public new void VirtualMethod(); // 0x100C5530 + } // Namespace: Il2CppTests.TestSources @@ -142,6 +149,7 @@ internal class TestOverrideAbstract : TestAbstract // TypeDefIndex: 1817 // Methods public override void AbstractMethod(); // 0x100C5530 + } // Namespace: Il2CppTests.TestSources @@ -152,6 +160,7 @@ internal class TestHideAbstractOverride : TestOverrideAbstract // TypeDefIndex: // Methods public new void AbstractMethod(); // 0x100C5530 + } // Namespace: Il2CppTests.TestSources @@ -162,6 +171,7 @@ internal class TestHideVirtualAndNewVirtual : Test // TypeDefIndex: 1819 // Methods public virtual new void VirtualMethod(); // 0x100C5530 + } // Namespace: Il2CppTests.TestSources @@ -172,6 +182,7 @@ internal class TestHideOverrideAndNewVirtual : TestOverride // TypeDefIndex: 182 // Methods public virtual new void VirtualMethod(); // 0x100C5530 + } // Namespace: Il2CppTests.TestSources @@ -182,6 +193,7 @@ internal abstract class TestAbstractNew : TestOverride // TypeDefIndex: 1821 // Methods public abstract new void VirtualMethod(); + } // Namespace: Il2CppTests.TestSources @@ -192,5 +204,6 @@ internal class TestNewNonVirtualMethod : Test // TypeDefIndex: 1822 // Methods public int ValueTypeReturnMethod(); // 0x100EF660 + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-Properties-x64.cs b/Il2CppTests/TestExpectedResults/GameAssembly-Properties-x64.cs index 1a99b0f..582937d 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-Properties-x64.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-Properties-x64.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x0000000180123590 public static string GetText(string fmt, params /* 0x00000001800091F0 */ object[] args); // 0x00000001802C64F0 + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-Properties-x86.cs b/Il2CppTests/TestExpectedResults/GameAssembly-Properties-x86.cs index 739bd67..e88df50 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-Properties-x86.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-Properties-x86.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x100F7810 public static string GetText(string fmt, params /* 0x10009AD0 */ object[] args); // 0x10261460 + } diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-References-x64.cs b/Il2CppTests/TestExpectedResults/GameAssembly-References-x64.cs index f0b9046..158e2f5 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-References-x64.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-References-x64.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x0000000180123590 public static string GetText(string fmt, params /* 0x0000000180009C10 */ object[] args); // 0x00000001802C64F0 + } @@ -86,8 +87,9 @@ internal class Test // TypeDefIndex: 1811 // Methods public void MethodWithRefParameters(int a, ref int b, int c, ref int d); // 0x00000001800EA7B0 - public void MethowWithInRefOut(in int a, ref int b, out int c); // 0x00000001803E0E60 - public ref float MethodWithRefReturnType(); // 0x00000001803E0E50 + public void MethodWithInRefOut(in int a, ref int b, out int c); // 0x00000001803E0E50 + public ref float MethodWithRefReturnType(); // 0x00000001803E0E60 + } // Namespace: Il2CppTests.TestSources diff --git a/Il2CppTests/TestExpectedResults/GameAssembly-References-x86.cs b/Il2CppTests/TestExpectedResults/GameAssembly-References-x86.cs index b8bb20e..f76171f 100644 --- a/Il2CppTests/TestExpectedResults/GameAssembly-References-x86.cs +++ b/Il2CppTests/TestExpectedResults/GameAssembly-References-x86.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x100F7810 public static string GetText(string fmt, params /* 0x1000A660 */ object[] args); // 0x10261460 + } @@ -86,8 +87,9 @@ internal class Test // TypeDefIndex: 1811 // Methods public void MethodWithRefParameters(int a, ref int b, int c, ref int d); // 0x100C5530 - public void MethowWithInRefOut(in int a, ref int b, out int c); // 0x1034DA70 - public ref float MethodWithRefReturnType(); // 0x1034DA60 + public void MethodWithInRefOut(in int a, ref int b, out int c); // 0x1034DA60 + public ref float MethodWithRefReturnType(); // 0x1034DA70 + } // Namespace: Il2CppTests.TestSources diff --git a/Il2CppTests/TestExpectedResults/GenericTypes.cs b/Il2CppTests/TestExpectedResults/GenericTypes.cs index 8cd3a77..fc6bcf1 100644 --- a/Il2CppTests/TestExpectedResults/GenericTypes.cs +++ b/Il2CppTests/TestExpectedResults/GenericTypes.cs @@ -1,30 +1,30 @@ // Image 0: mscorlib.dll - 0 -[assembly: AssemblyCompany] // 0x000A5390 -[assembly: AssemblyCopyright] // 0x000A5390 -[assembly: AssemblyDefaultAlias] // 0x000A5390 -[assembly: AssemblyDelaySign] // 0x000A5390 -[assembly: AssemblyDescription] // 0x000A5390 -[assembly: AssemblyFileVersion] // 0x000A5390 -[assembly: AssemblyInformationalVersion] // 0x000A5390 -[assembly: AssemblyKeyFile] // 0x000A5390 -[assembly: AssemblyProduct] // 0x000A5390 -[assembly: AssemblyTitle] // 0x000A5390 -[assembly: CLSCompliant] // 0x000A5390 -[assembly: CompilationRelaxations] // 0x000A5390 -[assembly: ComVisible] // 0x000A5390 -[assembly: Debuggable] // 0x000A5390 -[assembly: DefaultDependency] // 0x000A5390 -[assembly: Guid] // 0x000A5390 -[assembly: NeutralResourcesLanguage] // 0x000A5390 -[assembly: RuntimeCompatibility] // 0x000A5390 -[assembly: SatelliteContractVersion] // 0x000A5390 -[assembly: StringFreezing] // 0x000A5390 -[assembly: TypeLibVersion] // 0x000A5390 +[assembly: AssemblyCompany] // 0x000A534C +[assembly: AssemblyCopyright] // 0x000A534C +[assembly: AssemblyDefaultAlias] // 0x000A534C +[assembly: AssemblyDelaySign] // 0x000A534C +[assembly: AssemblyDescription] // 0x000A534C +[assembly: AssemblyFileVersion] // 0x000A534C +[assembly: AssemblyInformationalVersion] // 0x000A534C +[assembly: AssemblyKeyFile] // 0x000A534C +[assembly: AssemblyProduct] // 0x000A534C +[assembly: AssemblyTitle] // 0x000A534C +[assembly: CLSCompliant] // 0x000A534C +[assembly: CompilationRelaxations] // 0x000A534C +[assembly: ComVisible] // 0x000A534C +[assembly: Debuggable] // 0x000A534C +[assembly: DefaultDependency] // 0x000A534C +[assembly: Guid] // 0x000A534C +[assembly: NeutralResourcesLanguage] // 0x000A534C +[assembly: RuntimeCompatibility] // 0x000A534C +[assembly: SatelliteContractVersion] // 0x000A534C +[assembly: StringFreezing] // 0x000A534C +[assembly: TypeLibVersion] // 0x000A534C // Image 1: GenericTypes.dll - 1810 -[assembly: CompilationRelaxations] // 0x000A5684 -[assembly: Debuggable] // 0x000A5684 -[assembly: RuntimeCompatibility] // 0x000A5684 +[assembly: CompilationRelaxations] // 0x000A5754 +[assembly: Debuggable] // 0x000A5754 +[assembly: RuntimeCompatibility] // 0x000A5754 // Namespace: @@ -67,16 +67,18 @@ internal static class Consts // TypeDefIndex: 100 internal sealed class Locale // TypeDefIndex: 101 { // Constructors - private Locale(); // 0x003EC9C0 + private Locale(); // 0x003ECCE8 // Methods - public static string GetText(string msg); // 0x003EC9C8 - public static string GetText(string fmt, params /* 0x000A3BBC */ object[] args); // 0x003EC9CC + public static string GetText(string msg); // 0x003ECCF0 + public static string GetText(string fmt, params /* 0x000A3B78 */ object[] args); // 0x003ECCF4 + } + // Namespace: Il2CppTests.TestSources -public class Base // TypeDefIndex: 1811 +public class Base // TypeDefIndex: 1815 { // Constructors public Base(); @@ -84,13 +86,13 @@ public class Base // TypeDefIndex: 1811 } // Namespace: Il2CppTests.TestSources -public class Derived : Base // TypeDefIndex: 1812 +public class Derived : Base // TypeDefIndex: 1816 { // Fields public G> F; // 0x00 // Nested types - public class Nested // TypeDefIndex: 1813 + public class Nested // TypeDefIndex: 1817 { // Constructors public Nested(); @@ -103,7 +105,7 @@ public class Derived : Base // TypeDefIndex: 1812 } // Namespace: Il2CppTests.TestSources -public class G // TypeDefIndex: 1814 +public class G // TypeDefIndex: 1818 { // Constructors public G(); @@ -111,12 +113,46 @@ public class G // TypeDefIndex: 1814 } // Namespace: Il2CppTests.TestSources -internal class Test // TypeDefIndex: 1815 +internal class Test // TypeDefIndex: 1819 { // Constructors - public Test(); // 0x00561704 + public Test(); // 0x00561A3C // Methods - public void GenericTypesTest(); // 0x00561548 + public void GenericTypesTest(); // 0x00561880 + +} + +// Namespace: Il2CppTests.TestSources +internal class ConstrainedValueType // TypeDefIndex: 1820 + where V : struct +{ + // Constructors + public ConstrainedValueType(); + +} + +// Namespace: Il2CppTests.TestSources +internal class ConstrainedRefType // TypeDefIndex: 1821 + where R : class +{ + // Constructors + public ConstrainedRefType(); + + // Methods + [NullableContext] // 0x000A5740 + public void ConstrainedMethodNotNull(N notnullArgument, R bar); + public void ConstrainedUnmanaged(U unmanagedArgument) + where U : struct; + public void MultipleConstraintsMethod(C constrained) + where C : R, new(); + public void MultipleArgumentsMultipleConstraintsMethod(B baseArgument, I interfaceArgument) + where B : Derived, new() + where I : Test, IDisposable, IEnumerable; + public void DelegateConstraint(D del) + where D : Delegate; + public void EnumConstraint(E enumeration) + where E : Enum; + } diff --git a/Il2CppTests/TestExpectedResults/Methods.cs b/Il2CppTests/TestExpectedResults/Methods.cs index 3287f3d..bf1f3ae 100644 --- a/Il2CppTests/TestExpectedResults/Methods.cs +++ b/Il2CppTests/TestExpectedResults/Methods.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x003EC608 public static string GetText(string fmt, params /* 0x000A38C4 */ object[] args); // 0x003EC60C + } @@ -85,6 +86,7 @@ internal class Test // TypeDefIndex: 1811 public virtual void VirtualMethod(); // 0x00561188 public double ValueTypeReturnMethod(); // 0x0056118C public StringBuilder ReferenceTypeReturnMethod(); // 0x005611B4 + } // Namespace: Il2CppTests.TestSources @@ -92,6 +94,7 @@ public static class TestExtension // TypeDefIndex: 1812 { // Methods public static double DivideByXExtension(int a, float x); // 0x00561198 + } // Namespace: Il2CppTests.TestSources @@ -102,6 +105,7 @@ internal abstract class TestAbstract // TypeDefIndex: 1813 // Methods public abstract void AbstractMethod(); + } // Namespace: Il2CppTests.TestSources @@ -112,6 +116,7 @@ internal class TestOverride : Test // TypeDefIndex: 1814 // Methods public override void VirtualMethod(); // 0x00561294 + } // Namespace: Il2CppTests.TestSources @@ -122,6 +127,7 @@ internal class TestHideVirtual : Test // TypeDefIndex: 1815 // Methods public new void VirtualMethod(); // 0x0056126C + } // Namespace: Il2CppTests.TestSources @@ -132,6 +138,7 @@ internal class TestHideOverride : TestOverride // TypeDefIndex: 1816 // Methods public new void VirtualMethod(); // 0x00561254 + } // Namespace: Il2CppTests.TestSources @@ -142,6 +149,7 @@ internal class TestOverrideAbstract : TestAbstract // TypeDefIndex: 1817 // Methods public override void AbstractMethod(); // 0x00561298 + } // Namespace: Il2CppTests.TestSources @@ -152,6 +160,7 @@ internal class TestHideAbstractOverride : TestOverrideAbstract // TypeDefIndex: // Methods public new void AbstractMethod(); // 0x00561240 + } // Namespace: Il2CppTests.TestSources @@ -162,6 +171,7 @@ internal class TestHideVirtualAndNewVirtual : Test // TypeDefIndex: 1819 // Methods public virtual new void VirtualMethod(); // 0x00561278 + } // Namespace: Il2CppTests.TestSources @@ -172,6 +182,7 @@ internal class TestHideOverrideAndNewVirtual : TestOverride // TypeDefIndex: 182 // Methods public virtual new void VirtualMethod(); // 0x00561260 + } // Namespace: Il2CppTests.TestSources @@ -182,6 +193,7 @@ internal abstract class TestAbstractNew : TestOverride // TypeDefIndex: 1821 // Methods public abstract new void VirtualMethod(); + } // Namespace: Il2CppTests.TestSources @@ -192,5 +204,6 @@ internal class TestNewNonVirtualMethod : Test // TypeDefIndex: 1822 // Methods public int ValueTypeReturnMethod(); // 0x00561284 + } diff --git a/Il2CppTests/TestExpectedResults/Properties.cs b/Il2CppTests/TestExpectedResults/Properties.cs index f16b05b..d83195b 100644 --- a/Il2CppTests/TestExpectedResults/Properties.cs +++ b/Il2CppTests/TestExpectedResults/Properties.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x003EC6B0 public static string GetText(string fmt, params /* 0x000A3618 */ object[] args); // 0x003EC6B4 + } diff --git a/Il2CppTests/TestExpectedResults/References.cs b/Il2CppTests/TestExpectedResults/References.cs index a8e6bf0..7550a64 100644 --- a/Il2CppTests/TestExpectedResults/References.cs +++ b/Il2CppTests/TestExpectedResults/References.cs @@ -72,6 +72,7 @@ internal sealed class Locale // TypeDefIndex: 101 // Methods public static string GetText(string msg); // 0x003EC500 public static string GetText(string fmt, params /* 0x000A375C */ object[] args); // 0x003EC504 + } @@ -86,8 +87,9 @@ internal class Test // TypeDefIndex: 1811 // Methods public void MethodWithRefParameters(int a, ref int b, int c, ref int d); // 0x00561080 - public void MethowWithInRefOut(in int a, ref int b, out int c); // 0x00561084 + public void MethodWithInRefOut(in int a, ref int b, out int c); // 0x00561084 public ref float MethodWithRefReturnType(); // 0x00561090 + } // Namespace: Il2CppTests.TestSources diff --git a/Il2CppTests/TestSources/GenericTypes.cs b/Il2CppTests/TestSources/GenericTypes.cs index 9f7cbab..0abda70 100644 --- a/Il2CppTests/TestSources/GenericTypes.cs +++ b/Il2CppTests/TestSources/GenericTypes.cs @@ -5,6 +5,7 @@ */ using System; +using System.Collections.Generic; namespace Il2CppTests.TestSources { @@ -45,4 +46,29 @@ namespace Il2CppTests.TestSources Type tNested = typeof(Derived<>.Nested); } } + + // Constraints on type definitions + internal class ConstrainedValueType where V : struct {} // Value type constraint + internal class ConstrainedRefType where R : class { // Reference type constraint + + // Constraints on method definitions +#nullable enable + public void ConstrainedMethodNotNull(N notnullArgument, R bar) where N : notnull {} // Non-nullable reference type constraint (suppressed if not in nullable enable context) +#nullable restore + public unsafe void ConstrainedUnmanaged(U unmanagedArgument) where U : unmanaged {} // Unmanaged type constraint (added in C# 7.3; suppressed if not in unsafe context) + + // Multiple constraints + public void MultipleConstraintsMethod(C constrained) where C : R, new() {} // Derived type argument constraint + public parameterless constructor constraint + + // Multiple type arguments with multiple constraints + public void MultipleArgumentsMultipleConstraintsMethod(B baseArgument, I interfaceArgument) + where B : Derived, new() // Base type constraint + public parameterless constructor constraint + where I : Test, IDisposable, IEnumerable // Base type constraint + Interface implementation constraint x2 + { } + + // Special type constraints (these must be specified as their full type names and not the C# shorthand versions + // Added in C# 7.3 + public void DelegateConstraint(D del) where D : Delegate {} + public void EnumConstraint(E enumeration) where E : Enum {} + } } \ No newline at end of file