diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Correctness/InitializerTests.cs b/ICSharpCode.Decompiler.Tests/TestCases/Correctness/InitializerTests.cs index 69b9a67f6..31ba421e8 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Correctness/InitializerTests.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Correctness/InitializerTests.cs @@ -130,332 +130,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness } #region Array Initializers - public static void Array1() - { - InitializerTests.X(InitializerTests.Y(), new int[] - { - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - }); - } - - public static void Array2(int a, int b, int c) - { - InitializerTests.X(InitializerTests.Y(), new int[] - { - a, - 0, - b, - 0, - c - }); - } - - public static void NestedArray(int a, int b, int c) - { - InitializerTests.X(InitializerTests.Y(), new int[][] - { - new int[] - { - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - }, - new int[] - { - a, - b, - c - }, - new int[] - { - 1, - 2, - 3, - 4, - 5, - 6 - } - }); - } - - public static void NestedNullableArray(int a, int b, int c) - { - InitializerTests.X(InitializerTests.Y(), new int?[][] - { - new int?[] - { - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - null - }, - new int?[] - { - a, - b, - c, - null - }, - new int?[] - { - 1, - 2, - 3, - 4, - 5, - 6, - null - } - }); - } - public unsafe static void NestedPointerArray(int a, int b, int c) - { - InitializerTests.X(InitializerTests.Y(), new void*[][] - { - new void*[] - { - null - }, - new void*[] - { - (void*)200, - null - }, - new void*[] - { - (void*)100, - null - } - }); - } - - public static void ArrayBoolean() - { - InitializerTests.X(InitializerTests.Y(), new bool[] - { - true, - false, - true, - false, - false, - false, - true, - true - }); - } - - public static void ArrayByte() - { - InitializerTests.X(InitializerTests.Y(), new byte[] - { - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 254, - 255 - }); - } - public static void ArraySByte() - { - InitializerTests.X(InitializerTests.Y(), new sbyte[] - { - -128, - -127, - 0, - 1, - 2, - 3, - 4, - 127 - }); - } - - public static void ArrayShort() - { - InitializerTests.X(InitializerTests.Y(), new short[] - { - -32768, - -1, - 0, - 1, - 32767 - }); - } - - public static void ArrayUShort() - { - InitializerTests.X(InitializerTests.Y(), new ushort[] - { - 0, - 1, - 32767, - 32768, - 65534, - 65535 - }); - } - - public static void ArrayInt() - { - InitializerTests.X(InitializerTests.Y(), new int[] - { - 1, - -2, - 2000000000, - 4, - 5, - -6, - 7, - 8, - 9, - 10 - }); - } - - public static void ArrayUInt() - { - InitializerTests.X(InitializerTests.Y(), new uint[] - { - 1u, - 2000000000u, - 3000000000u, - 4u, - 5u, - 6u, - 7u, - 8u, - 9u, - 10u - }); - } - - public static void ArrayLong() - { - InitializerTests.X(InitializerTests.Y(), new long[] - { - -4999999999999999999L, - -1L, - 0L, - 1L, - 4999999999999999999L - }); - } - - public static void ArrayULong() - { - InitializerTests.X(InitializerTests.Y(), new ulong[] - { - 1uL, - 2000000000uL, - 3000000000uL, - 4uL, - 5uL, - 6uL, - 7uL, - 8uL, - 4999999999999999999uL, - 9999999999999999999uL - }); - } - - public static void ArrayFloat() - { - InitializerTests.X(InitializerTests.Y(), new float[] - { - -1.5f, - 0f, - 1.5f, - float.NegativeInfinity, - float.PositiveInfinity, - float.NaN - }); - } - - public static void ArrayDouble() - { - InitializerTests.X(InitializerTests.Y(), new double[] - { - -1.5, - 0.0, - 1.5, - double.NegativeInfinity, - double.PositiveInfinity, - double.NaN - }); - } - - public static void ArrayDecimal() - { - InitializerTests.X(InitializerTests.Y(), new decimal[] - { - -100m, - 0m, - 100m, - -79228162514264337593543950335m, - 79228162514264337593543950335m, - 0.0000001m - }); - } - - public static void ArrayString() - { - InitializerTests.X(InitializerTests.Y(), new string[] - { - "", - null, - "Hello", - "World" - }); - } - - public static void ArrayEnum() - { - InitializerTests.X(InitializerTests.Y(), new InitializerTests.MyEnum[] - { - InitializerTests.MyEnum.a, - InitializerTests.MyEnum.b, - InitializerTests.MyEnum.a, - InitializerTests.MyEnum.b - }); - } - - public static void RecursiveArrayInitializer() - { - int[] array = new int[3]; - array[0] = 1; - array[1] = 2; - array[2] = array[1] + 1; - array[0] = 0; - } #endregion public static void CollectionInitializerList() diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.cs index 5fbcc60c9..a29068b13 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.cs @@ -279,58 +279,326 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests { return c; } + + private static int GetInt() + { + return 1; + } + + private static string GetString() + { + return "Test"; + } + + private static void NoOp(Guid?[] array) + { + + } + + private void Data_TestEvent(object sender, EventArgs e) + { + throw new NotImplementedException(); + } #endregion - public C Test1() + #region Array initializers + public static void Array1() { - C c = new C(); - c.L = new List(); - c.L.Add(new S(1)); - return c; + X(Y(), new int[10] { + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + }); } - public C Test1Alternative() + public static void Array2(int a, int b, int c) { - return TestCall(1, new C { - L = new List { - new S(1) + X(Y(), new int[5] { + a, + 0, + b, + 0, + c + }); + } + + public static void NestedArray(int a, int b, int c) + { + X(Y(), new int[3][] { + new int[10] { + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + }, + new int[3] { + a, + b, + c + }, + new int[6] { + 1, + 2, + 3, + 4, + 5, + 6 } }); } - public C Test2() + public static void NestedNullableArray(int a, int b, int c) { - C c = new C(); - c.Z = 1; - c.Z = 2; - return c; + X(Y(), new int?[3][] { + new int?[11] { + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + null + }, + new int?[4] { + a, + b, + c, + null + }, + new int?[7] { + 1, + 2, + 3, + 4, + 5, + 6, + null + } + }); + } + public unsafe static void NestedPointerArray(int a, int b, int c) + { + X(Y(), new void*[3][] { + new void*[1] { + null + }, + new void*[2] { + (void*)200, + null + }, + new void*[2] { + (void*)100, + null + } + }); } - public C Test3() + public static void ArrayBoolean() { - C c = new C(); - c.Y = new S(1); - c.Y.A = 2; - return c; + X(Y(), new bool[8] { + true, + false, + true, + false, + false, + false, + true, + true + }); } - public C Test3b() + public static void ArrayByte() { - return TestCall(0, new C { - Z = 1, - Y = { - A = 2 - } + X(Y(), new byte[10] { + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 254, + byte.MaxValue }); } - public C Test4() + public static void ArraySByte() { - C c = new C(); - c.Y.A = 1; - c.Z = 2; - c.Y.B = 3; - return c; + X(Y(), new sbyte[8] { + sbyte.MinValue, + -127, + 0, + 1, + 2, + 3, + 4, + sbyte.MaxValue + }); + } + + public static void ArrayShort() + { + X(Y(), new short[5] { + short.MinValue, + -1, + 0, + 1, + short.MaxValue + }); + } + + public static void ArrayUShort() + { + X(Y(), new ushort[6] { + 0, + 1, + 32767, + 32768, + 65534, + ushort.MaxValue + }); + } + + public static void ArrayInt() + { + X(Y(), new int[10] { + 1, + -2, + 2000000000, + 4, + 5, + -6, + 7, + 8, + 9, + 10 + }); + } + + public static void ArrayUInt() + { + X(Y(), new uint[10] { + 1u, + 2000000000u, + 3000000000u, + 4u, + 5u, + 6u, + 7u, + 8u, + 9u, + 10u + }); + } + + public static void ArrayLong() + { + X(Y(), new long[5] { + -4999999999999999999L, + -1L, + 0L, + 1L, + 4999999999999999999L + }); + } + + public static void ArrayULong() + { + X(Y(), new ulong[10] { + 1uL, + 2000000000uL, + 3000000000uL, + 4uL, + 5uL, + 6uL, + 7uL, + 8uL, + 4999999999999999999uL, + 9999999999999999999uL + }); + } + + public static void ArrayFloat() + { + X(Y(), new float[6] { + -1.5f, + 0f, + 1.5f, + float.NegativeInfinity, + float.PositiveInfinity, + float.NaN + }); + } + + public static void ArrayDouble() + { + X(Y(), new double[6] { + -1.5, + 0.0, + 1.5, + double.NegativeInfinity, + double.PositiveInfinity, + double.NaN + }); + } + + public static void ArrayDecimal() + { + X(Y(), new decimal[6] { + -100m, + 0m, + 100m, + decimal.MinValue, + decimal.MaxValue, + 0.0000001m + }); + } + + public static void ArrayString() + { + X(Y(), new string[4] { + "", + null, + "Hello", + "World" + }); + } + + public static void ArrayEnum() + { + X(Y(), new MyEnum[4] { + MyEnum.a, + MyEnum.b, + MyEnum.a, + MyEnum.b + }); + } + + public static void RecursiveArrayInitializer() + { + int[] array = new int[3]; + array[0] = 1; + array[1] = 2; + array[2] = array[1] + 1; + array[0] = 0; } public static void InvalidIndices(int a) @@ -357,102 +625,75 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests X(Y(), array); } - public static void ExtensionMethodInCollectionInitializer() + public static void Issue953_MissingNullableSpecifierForArrayInitializer() { -#if CS60 - X(Y(), new CustomList { - { - 1, - 2 - } + NoOp(new Guid?[1] { + Guid.Empty }); -#else - CustomList customList = new CustomList(); - customList.Add(1, 2); - X(Y(), customList); -#endif - } - - public static void NoCollectionInitializerBecauseOfTypeArguments() - { - CustomList customList = new CustomList(); - customList.Add("int"); - Console.WriteLine(customList); } - public static void CollectionInitializerWithParamsMethod() + private void Issue907_Test3(string text) { - X(Y(), new CustomList { + X(Y(), new Dictionary { { - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 + "", + text } }); } + #endregion - public static void CollectionInitializerList() + #region Object initializers + public C Test1() { - X(Y(), new List { - 1, - 2, - 3 + C c = new C(); + c.L = new List(); + c.L.Add(new S(1)); + return c; + } + + public C Test1Alternative() + { + return TestCall(1, new C { + L = new List { + new S(1) + } }); } - public static object RecursiveCollectionInitializer() + public C Test2() { - List list = new List(); - list.Add(list); - return list; + C c = new C(); + c.Z = 1; + c.Z = 2; + return c; } - public static void CollectionInitializerDictionary() + public C Test3() { - X(Y(), new Dictionary { - { - "First", - 1 - }, - { - "Second", - 2 - }, - { - "Third", - 3 - } - }); + C c = new C(); + c.Y = new S(1); + c.Y.A = 2; + return c; } - public static void CollectionInitializerDictionaryWithEnumTypes() + public C Test3b() { - X(Y(), new Dictionary { - { - MyEnum.a, - MyEnum2.c - }, - { - MyEnum.b, - MyEnum2.d - } - }); + return TestCall(0, new C { + Z = 1, + Y = { + A = 2 + } + }); } - public static void NotACollectionInitializer() + public C Test4() { - List list = new List(); - list.Add(1); - list.Add(2); - list.Add(3); - X(Y(), list); + C c = new C(); + c.Y.A = 1; + c.Z = 2; + c.Y.B = 3; + return c; } public static void ObjectInitializer() @@ -515,87 +756,25 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests { X(Y(), new Data { a = MyEnum.a, - PropertyList = { - MyEnum2.c, - MyEnum2.d - } - }); - } - - public static void ObjectInitializerWithInitializationOfNestedObjects() - { - X(Y(), new Data { - MoreData = { - a = MyEnum.a, - MoreData = { - a = MyEnum.b - } - } - }); - } - - private static int GetInt() - { - return 1; - } - - private static string GetString() - { - return "Test"; - } - - private static void NoOp(Guid?[] array) - { - - } - -#if CS60 - public static void SimpleDictInitializer() - { - X(Y(), new Data { - MoreData = { - a = MyEnum.a, - [2] = null + PropertyList = { + MyEnum2.c, + MyEnum2.d } }); } - public static void MixedObjectAndDictInitializer() + public static void ObjectInitializerWithInitializationOfNestedObjects() { X(Y(), new Data { MoreData = { a = MyEnum.a, - [GetInt()] = { - a = MyEnum.b, - FieldList = { - MyEnum2.c - }, - [GetInt(), GetString()] = new Data(), - [2] = null + MoreData = { + a = MyEnum.b } } }); } - private void NestedListWithIndexInitializer(MyEnum myEnum) - { -#if !OPT - List> list = new List> { -#else - List> obj = new List> { -#endif - [0] = { - 1, - 2, - 3 - }, - [1] = { - (int)myEnum - } - }; - } -#endif - public static void ObjectInitializerWithInitializationOfDeeplyNestedObjects() { X(Y(), new Data { @@ -687,11 +866,11 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests }); } - public static void Bug270_NestedInitialisers() + public static void Issue270_NestedInitialisers() { NumberFormatInfo[] source = null; - TestCall(0, new Thread(Bug270_NestedInitialisers) { + TestCall(0, new Thread(Issue270_NestedInitialisers) { Priority = ThreadPriority.BelowNormal, CurrentCulture = new CultureInfo(0) { DateTimeFormat = new DateTimeFormatInfo { @@ -704,53 +883,44 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests }); } - public static void Bug953_MissingNullableSpecifierForArrayInitializer() - { - NoOp(new Guid?[1] { - Guid.Empty - }); - } - - - private void Issue907_Test3(string text) + public OtherItem2 Issue1345() { - X(Y(), new Dictionary { - { - "", - text - } - }); + OtherItem2 otherItem = new OtherItem2(); + otherItem.Data.Nullable = 3m; + return otherItem; } - private void Issue1250_Test1(MyEnum value) + public OtherItem2 Issue1345b() { - X(Y(), new C { - Z = (int)value - }); + OtherItem2 otherItem = new OtherItem2(); + otherItem.Data2.Nullable = 3m; + return otherItem; } - #if CS60 - private void Issue1250_Test2(MyEnum value) + public OtherItem2 Issue1345c() { - X(Y(), new C { - [(int)value] = new S((int)value) - }); + OtherItem2 otherItem = new OtherItem2(); + otherItem.Data3.Nullable = 3m; + return otherItem; } - private void Issue1250_Test3(int value) + private Data Issue1345_FalsePositive() { - X(Y(), new C { - [value] = new S(value) - }); + return new Data { + ReadOnlyPropertyList = { + MyEnum2.c, + MyEnum2.d + } + }; } +#endif - private void Issue1250_Test4(int value) + private void Issue1250_Test1(MyEnum value) { X(Y(), new C { - [(object)value] = new S(value) + Z = (int)value }); } -#endif private void Issue1251_Test(List list, OtherItem otherItem) { @@ -776,41 +946,175 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests return null; } - private void Data_TestEvent(object sender, EventArgs e) + #endregion + + #region Collection initializer + + public static void ExtensionMethodInCollectionInitializer() { - throw new NotImplementedException(); +#if CS60 + X(Y(), new CustomList { + { + 1, + 2 + } + }); +#else + CustomList customList = new CustomList(); + customList.Add(1, 2); + X(Y(), customList); +#endif } - public OtherItem2 Issue1345() + public static void NoCollectionInitializerBecauseOfTypeArguments() { - OtherItem2 otherItem = new OtherItem2(); - otherItem.Data.Nullable = 3m; - return otherItem; + CustomList customList = new CustomList(); + customList.Add("int"); + Console.WriteLine(customList); } - public OtherItem2 Issue1345b() + public static void CollectionInitializerWithParamsMethod() { - OtherItem2 otherItem = new OtherItem2(); - otherItem.Data2.Nullable = 3m; - return otherItem; + X(Y(), new CustomList { + { + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + } + }); + } + + public static void CollectionInitializerList() + { + X(Y(), new List { + 1, + 2, + 3 + }); + } + + public static object RecursiveCollectionInitializer() + { + List list = new List(); + list.Add(list); + return list; + } + + public static void CollectionInitializerDictionary() + { + X(Y(), new Dictionary { + { + "First", + 1 + }, + { + "Second", + 2 + }, + { + "Third", + 3 + } + }); + } + + public static void CollectionInitializerDictionaryWithEnumTypes() + { + X(Y(), new Dictionary { + { + MyEnum.a, + MyEnum2.c + }, + { + MyEnum.b, + MyEnum2.d + } + }); + } + + public static void NotACollectionInitializer() + { + List list = new List(); + list.Add(1); + list.Add(2); + list.Add(3); + X(Y(), list); } + #if CS60 - public OtherItem2 Issue1345c() + public static void SimpleDictInitializer() { - OtherItem2 otherItem = new OtherItem2(); - otherItem.Data3.Nullable = 3m; - return otherItem; + X(Y(), new Data { + MoreData = { + a = MyEnum.a, + [2] = null + } + }); } - private Data Issue1345_FalsePositive() + public static void MixedObjectAndDictInitializer() { - return new Data { - ReadOnlyPropertyList = { - MyEnum2.c, - MyEnum2.d + X(Y(), new Data { + MoreData = { + a = MyEnum.a, + [GetInt()] = { + a = MyEnum.b, + FieldList = { + MyEnum2.c + }, + [GetInt(), GetString()] = new Data(), + [2] = null + } + } + }); + } + + private void NestedListWithIndexInitializer(MyEnum myEnum) + { +#if !OPT + List> list = new List> { +#else + List> obj = new List> { +#endif + [0] = { + 1, + 2, + 3 + }, + [1] = { + (int)myEnum } }; } + + private void Issue1250_Test2(MyEnum value) + { + X(Y(), new C { + [(int)value] = new S((int)value) + }); + } + + private void Issue1250_Test3(int value) + { + X(Y(), new C { + [value] = new S(value) + }); + } + + private void Issue1250_Test4(int value) + { + X(Y(), new C { + [(object)value] = new S(value) + }); + } #endif + #endregion } } \ No newline at end of file diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.il index ea85b3f7a..9ceef883b 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.il @@ -1264,9 +1264,9 @@ } // end of property OtherItem2::Data2 } // end of class OtherItem2 - .field private static class [mscorlib]System.EventHandler 'CS$<>9__CachedAnonymousMethodDelegate9' + .field private static class [mscorlib]System.EventHandler 'CS$<>9__CachedAnonymousMethodDelegate6' .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .field private static class [mscorlib]System.Func`2 'CS$<>9__CachedAnonymousMethodDelegate1d' + .field private static class [mscorlib]System.Func`2 'CS$<>9__CachedAnonymousMethodDelegate1a' .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .method private hidebysig static void X(object a, object b) cil managed @@ -1317,493 +1317,1036 @@ IL_0006: ret } // end of method TestCases::TestCall - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test1() cil managed - { - // Code size 42 (0x2a) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) - IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000d: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_0012: ldloc.0 - IL_0013: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_0018: ldc.i4.1 - IL_0019: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_001e: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0023: nop - IL_0024: ldloc.0 - IL_0025: stloc.1 - IL_0026: br.s IL_0028 - - IL_0028: ldloc.1 - IL_0029: ret - } // end of method TestCases::Test1 - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test1Alternative() cil managed + .method private hidebysig static int32 + GetInt() cil managed { - // Code size 45 (0x2d) - .maxstack 4 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class [mscorlib]System.Collections.Generic.List`1 V_1, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_2) + // Code size 7 (0x7) + .maxstack 1 + .locals init (int32 V_0) IL_0000: nop IL_0001: ldc.i4.1 - IL_0002: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000e: stloc.1 - IL_000f: ldloc.1 - IL_0010: ldc.i4.1 - IL_0011: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_0016: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001b: nop - IL_001c: ldloc.1 - IL_001d: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_0022: ldloc.0 - IL_0023: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) - IL_0028: stloc.2 - IL_0029: br.s IL_002b + IL_0002: stloc.0 + IL_0003: br.s IL_0005 - IL_002b: ldloc.2 - IL_002c: ret - } // end of method TestCases::Test1Alternative + IL_0005: ldloc.0 + IL_0006: ret + } // end of method TestCases::GetInt - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test2() cil managed + .method private hidebysig static string + GetString() cil managed { - // Code size 27 (0x1b) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + // Code size 11 (0xb) + .maxstack 1 + .locals init (string V_0) IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0001: ldstr "Test" IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.1 - IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_000e: ldloc.0 - IL_000f: ldc.i4.2 - IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_0015: ldloc.0 - IL_0016: stloc.1 - IL_0017: br.s IL_0019 + IL_0007: br.s IL_0009 - IL_0019: ldloc.1 - IL_001a: ret - } // end of method TestCases::Test2 + IL_0009: ldloc.0 + IL_000a: ret + } // end of method TestCases::GetString - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test3() cil managed + .method private hidebysig static void NoOp(valuetype [mscorlib]System.Nullable`1[] 'array') cil managed { - // Code size 37 (0x25) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + // Code size 2 (0x2) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.1 - IL_0009: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_000e: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0013: ldloc.0 - IL_0014: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0019: ldc.i4.2 - IL_001a: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_001f: ldloc.0 - IL_0020: stloc.1 - IL_0021: br.s IL_0023 - - IL_0023: ldloc.1 - IL_0024: ret - } // end of method TestCases::Test3 + IL_0001: ret + } // end of method TestCases::NoOp - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test3b() cil managed + .method private hidebysig instance void + Data_TestEvent(object sender, + class [mscorlib]System.EventArgs e) cil managed { - // Code size 38 (0x26) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + // Code size 7 (0x7) + .maxstack 8 IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldc.i4.1 - IL_000a: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_000f: ldloc.0 - IL_0010: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0015: ldc.i4.2 - IL_0016: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_001b: ldloc.0 - IL_001c: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) - IL_0021: stloc.1 - IL_0022: br.s IL_0024 - - IL_0024: ldloc.1 - IL_0025: ret - } // end of method TestCases::Test3b + IL_0001: newobj instance void [mscorlib]System.NotImplementedException::.ctor() + IL_0006: throw + } // end of method TestCases::Data_TestEvent - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test4() cil managed + .method public hidebysig static void Array1() cil managed { - // Code size 44 (0x2c) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + // Code size 31 (0x1f) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_000d: ldc.i4.1 - IL_000e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_0013: ldloc.0 - IL_0014: ldc.i4.2 - IL_0015: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_001a: ldloc.0 - IL_001b: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0020: ldc.i4.3 - IL_0021: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::B - IL_0026: ldloc.0 - IL_0027: stloc.1 - IL_0028: br.s IL_002a - - IL_002a: ldloc.1 - IL_002b: ret - } // end of method TestCases::Test4 + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.s 10 + IL_0008: newarr [mscorlib]System.Int32 + IL_000d: dup + IL_000e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'$$method0x600000a-1' + IL_0013: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001d: nop + IL_001e: ret + } // end of method TestCases::Array1 - .method public hidebysig static void InvalidIndices(int32 a) cil managed + .method public hidebysig static void Array2(int32 a, + int32 b, + int32 c) cil managed { - // Code size 25 (0x19) - .maxstack 3 + // Code size 33 (0x21) + .maxstack 4 .locals init (int32[] V_0) IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: newarr [mscorlib]System.Int32 - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldc.i4.1 - IL_000a: ldarg.0 - IL_000b: stelem.i4 - IL_000c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.5 + IL_0007: newarr [mscorlib]System.Int32 + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.0 + IL_000f: ldarg.0 + IL_0010: stelem.i4 IL_0011: ldloc.0 - IL_0012: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0012: ldc.i4.2 + IL_0013: ldarg.1 + IL_0014: stelem.i4 + IL_0015: ldloc.0 + IL_0016: ldc.i4.4 + IL_0017: ldarg.2 + IL_0018: stelem.i4 + IL_0019: ldloc.0 + IL_001a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0017: nop - IL_0018: ret - } // end of method TestCases::InvalidIndices + IL_001f: nop + IL_0020: ret + } // end of method TestCases::Array2 - .method public hidebysig static void InvalidIndices2(int32 a) cil managed + .method public hidebysig static void NestedArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 25 (0x19) - .maxstack 3 - .locals init (int32[] V_0) + // Code size 85 (0x55) + .maxstack 6 + .locals init (int32[][] V_0, + int32[] V_1) IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: newarr [mscorlib]System.Int32 - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldc.i4.m1 - IL_000a: ldarg.0 - IL_000b: stelem.i4 - IL_000c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0011: ldloc.0 - IL_0012: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.3 + IL_0007: newarr int32[] + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.0 + IL_000f: ldc.i4.s 10 + IL_0011: newarr [mscorlib]System.Int32 + IL_0016: dup + IL_0017: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'$$method0x600000c-1' + IL_001c: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0021: stelem.ref + IL_0022: ldloc.0 + IL_0023: ldc.i4.1 + IL_0024: ldc.i4.3 + IL_0025: newarr [mscorlib]System.Int32 + IL_002a: stloc.1 + IL_002b: ldloc.1 + IL_002c: ldc.i4.0 + IL_002d: ldarg.0 + IL_002e: stelem.i4 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: ldarg.1 + IL_0032: stelem.i4 + IL_0033: ldloc.1 + IL_0034: ldc.i4.2 + IL_0035: ldarg.2 + IL_0036: stelem.i4 + IL_0037: ldloc.1 + IL_0038: stelem.ref + IL_0039: ldloc.0 + IL_003a: ldc.i4.2 + IL_003b: ldc.i4.6 + IL_003c: newarr [mscorlib]System.Int32 + IL_0041: dup + IL_0042: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=24' ''::'$$method0x600000c-2' + IL_0047: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_004c: stelem.ref + IL_004d: ldloc.0 + IL_004e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0017: nop - IL_0018: ret - } // end of method TestCases::InvalidIndices2 + IL_0053: nop + IL_0054: ret + } // end of method TestCases::NestedArray - .method public hidebysig static void IndicesInWrongOrder(int32 a, - int32 b) cil managed + .method public hidebysig static void NestedNullableArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 29 (0x1d) - .maxstack 3 - .locals init (int32[] V_0) + // Code size 464 (0x1d0) + .maxstack 5 + .locals init (valuetype [mscorlib]System.Nullable`1[][] V_0, + valuetype [mscorlib]System.Nullable`1[] V_1, + valuetype [mscorlib]System.Nullable`1 V_2) IL_0000: nop - IL_0001: ldc.i4.5 - IL_0002: newarr [mscorlib]System.Int32 - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldc.i4.2 - IL_000a: ldarg.1 - IL_000b: stelem.i4 - IL_000c: ldloc.0 - IL_000d: ldc.i4.1 - IL_000e: ldarg.0 - IL_000f: stelem.i4 - IL_0010: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0015: ldloc.0 - IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_001b: nop - IL_001c: ret - } // end of method TestCases::IndicesInWrongOrder + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.3 + IL_0007: newarr valuetype [mscorlib]System.Nullable`1[] + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.0 + IL_000f: ldc.i4.s 11 + IL_0011: newarr valuetype [mscorlib]System.Nullable`1 + IL_0016: stloc.1 + IL_0017: ldloc.1 + IL_0018: ldc.i4.0 + IL_0019: ldelema valuetype [mscorlib]System.Nullable`1 + IL_001e: ldc.i4.1 + IL_001f: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0024: stobj valuetype [mscorlib]System.Nullable`1 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0030: ldc.i4.2 + IL_0031: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0036: stobj valuetype [mscorlib]System.Nullable`1 + IL_003b: ldloc.1 + IL_003c: ldc.i4.2 + IL_003d: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0042: ldc.i4.3 + IL_0043: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0048: stobj valuetype [mscorlib]System.Nullable`1 + IL_004d: ldloc.1 + IL_004e: ldc.i4.3 + IL_004f: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0054: ldc.i4.4 + IL_0055: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_005a: stobj valuetype [mscorlib]System.Nullable`1 + IL_005f: ldloc.1 + IL_0060: ldc.i4.4 + IL_0061: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0066: ldc.i4.5 + IL_0067: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_006c: stobj valuetype [mscorlib]System.Nullable`1 + IL_0071: ldloc.1 + IL_0072: ldc.i4.5 + IL_0073: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0078: ldc.i4.6 + IL_0079: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_007e: stobj valuetype [mscorlib]System.Nullable`1 + IL_0083: ldloc.1 + IL_0084: ldc.i4.6 + IL_0085: ldelema valuetype [mscorlib]System.Nullable`1 + IL_008a: ldc.i4.7 + IL_008b: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0090: stobj valuetype [mscorlib]System.Nullable`1 + IL_0095: ldloc.1 + IL_0096: ldc.i4.7 + IL_0097: ldelema valuetype [mscorlib]System.Nullable`1 + IL_009c: ldc.i4.8 + IL_009d: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00a2: stobj valuetype [mscorlib]System.Nullable`1 + IL_00a7: ldloc.1 + IL_00a8: ldc.i4.8 + IL_00a9: ldelema valuetype [mscorlib]System.Nullable`1 + IL_00ae: ldc.i4.s 9 + IL_00b0: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00b5: stobj valuetype [mscorlib]System.Nullable`1 + IL_00ba: ldloc.1 + IL_00bb: ldc.i4.s 9 + IL_00bd: ldelema valuetype [mscorlib]System.Nullable`1 + IL_00c2: ldc.i4.s 10 + IL_00c4: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00c9: stobj valuetype [mscorlib]System.Nullable`1 + IL_00ce: ldloc.1 + IL_00cf: ldc.i4.s 10 + IL_00d1: ldelema valuetype [mscorlib]System.Nullable`1 + IL_00d6: ldloca.s V_2 + IL_00d8: initobj valuetype [mscorlib]System.Nullable`1 + IL_00de: ldloc.2 + IL_00df: stobj valuetype [mscorlib]System.Nullable`1 + IL_00e4: ldloc.1 + IL_00e5: stelem.ref + IL_00e6: ldloc.0 + IL_00e7: ldc.i4.1 + IL_00e8: ldc.i4.4 + IL_00e9: newarr valuetype [mscorlib]System.Nullable`1 + IL_00ee: stloc.1 + IL_00ef: ldloc.1 + IL_00f0: ldc.i4.0 + IL_00f1: ldelema valuetype [mscorlib]System.Nullable`1 + IL_00f6: ldarg.0 + IL_00f7: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00fc: stobj valuetype [mscorlib]System.Nullable`1 + IL_0101: ldloc.1 + IL_0102: ldc.i4.1 + IL_0103: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0108: ldarg.1 + IL_0109: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_010e: stobj valuetype [mscorlib]System.Nullable`1 + IL_0113: ldloc.1 + IL_0114: ldc.i4.2 + IL_0115: ldelema valuetype [mscorlib]System.Nullable`1 + IL_011a: ldarg.2 + IL_011b: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0120: stobj valuetype [mscorlib]System.Nullable`1 + IL_0125: ldloc.1 + IL_0126: ldc.i4.3 + IL_0127: ldelema valuetype [mscorlib]System.Nullable`1 + IL_012c: ldloca.s V_2 + IL_012e: initobj valuetype [mscorlib]System.Nullable`1 + IL_0134: ldloc.2 + IL_0135: stobj valuetype [mscorlib]System.Nullable`1 + IL_013a: ldloc.1 + IL_013b: stelem.ref + IL_013c: ldloc.0 + IL_013d: ldc.i4.2 + IL_013e: ldc.i4.7 + IL_013f: newarr valuetype [mscorlib]System.Nullable`1 + IL_0144: stloc.1 + IL_0145: ldloc.1 + IL_0146: ldc.i4.0 + IL_0147: ldelema valuetype [mscorlib]System.Nullable`1 + IL_014c: ldc.i4.1 + IL_014d: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0152: stobj valuetype [mscorlib]System.Nullable`1 + IL_0157: ldloc.1 + IL_0158: ldc.i4.1 + IL_0159: ldelema valuetype [mscorlib]System.Nullable`1 + IL_015e: ldc.i4.2 + IL_015f: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0164: stobj valuetype [mscorlib]System.Nullable`1 + IL_0169: ldloc.1 + IL_016a: ldc.i4.2 + IL_016b: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0170: ldc.i4.3 + IL_0171: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0176: stobj valuetype [mscorlib]System.Nullable`1 + IL_017b: ldloc.1 + IL_017c: ldc.i4.3 + IL_017d: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0182: ldc.i4.4 + IL_0183: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0188: stobj valuetype [mscorlib]System.Nullable`1 + IL_018d: ldloc.1 + IL_018e: ldc.i4.4 + IL_018f: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0194: ldc.i4.5 + IL_0195: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_019a: stobj valuetype [mscorlib]System.Nullable`1 + IL_019f: ldloc.1 + IL_01a0: ldc.i4.5 + IL_01a1: ldelema valuetype [mscorlib]System.Nullable`1 + IL_01a6: ldc.i4.6 + IL_01a7: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_01ac: stobj valuetype [mscorlib]System.Nullable`1 + IL_01b1: ldloc.1 + IL_01b2: ldc.i4.6 + IL_01b3: ldelema valuetype [mscorlib]System.Nullable`1 + IL_01b8: ldloca.s V_2 + IL_01ba: initobj valuetype [mscorlib]System.Nullable`1 + IL_01c0: ldloc.2 + IL_01c1: stobj valuetype [mscorlib]System.Nullable`1 + IL_01c6: ldloc.1 + IL_01c7: stelem.ref + IL_01c8: ldloc.0 + IL_01c9: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_01ce: nop + IL_01cf: ret + } // end of method TestCases::NestedNullableArray - .method public hidebysig static void ExtensionMethodInCollectionInitializer() cil managed + .method public hidebysig static void NestedPointerArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 43 (0x2b) - .maxstack 4 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0, - int32[] V_1) + // Code size 84 (0x54) + .maxstack 6 + .locals init (void*[][] V_0, + void*[] V_1) IL_0000: nop - IL_0001: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.2 - IL_0009: newarr [mscorlib]System.Int32 - IL_000e: stloc.1 - IL_000f: ldloc.1 - IL_0010: ldc.i4.0 - IL_0011: ldc.i4.1 - IL_0012: stelem.i4 - IL_0013: ldloc.1 - IL_0014: ldc.i4.1 - IL_0015: ldc.i4.2 - IL_0016: stelem.i4 - IL_0017: ldloc.1 - IL_0018: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) - IL_001d: nop - IL_001e: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0023: ldloc.0 - IL_0024: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.3 + IL_0007: newarr void*[] + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.0 + IL_000f: ldc.i4.1 + IL_0010: newarr void* + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.0 + IL_0018: ldc.i4.0 + IL_0019: conv.u + IL_001a: stelem.i + IL_001b: ldloc.1 + IL_001c: stelem.ref + IL_001d: ldloc.0 + IL_001e: ldc.i4.1 + IL_001f: ldc.i4.2 + IL_0020: newarr void* + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldc.i4.0 + IL_0028: ldc.i4 0xc8 + IL_002d: conv.i + IL_002e: stelem.i + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: ldc.i4.0 + IL_0032: conv.u + IL_0033: stelem.i + IL_0034: ldloc.1 + IL_0035: stelem.ref + IL_0036: ldloc.0 + IL_0037: ldc.i4.2 + IL_0038: ldc.i4.2 + IL_0039: newarr void* + IL_003e: stloc.1 + IL_003f: ldloc.1 + IL_0040: ldc.i4.0 + IL_0041: ldc.i4.s 100 + IL_0043: conv.i + IL_0044: stelem.i + IL_0045: ldloc.1 + IL_0046: ldc.i4.1 + IL_0047: ldc.i4.0 + IL_0048: conv.u + IL_0049: stelem.i + IL_004a: ldloc.1 + IL_004b: stelem.ref + IL_004c: ldloc.0 + IL_004d: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0029: nop - IL_002a: ret - } // end of method TestCases::ExtensionMethodInCollectionInitializer + IL_0052: nop + IL_0053: ret + } // end of method TestCases::NestedPointerArray - .method public hidebysig static void NoCollectionInitializerBecauseOfTypeArguments() cil managed + .method public hidebysig static void ArrayBoolean() cil managed { - // Code size 27 (0x1b) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) + // Code size 30 (0x1e) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldstr "int" - IL_000d: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(string) - IL_0012: nop - IL_0013: ldloc.0 - IL_0014: call void [mscorlib]System.Console::WriteLine(object) - IL_0019: nop - IL_001a: ret - } // end of method TestCases::NoCollectionInitializerBecauseOfTypeArguments + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.8 + IL_0007: newarr [mscorlib]System.Boolean + IL_000c: dup + IL_000d: ldtoken field int64 ''::'$$method0x600000f-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayBoolean - .method public hidebysig static void CollectionInitializerWithParamsMethod() cil managed + .method public hidebysig static void ArrayByte() cil managed { - // Code size 79 (0x4f) - .maxstack 5 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0, - int32[] V_1) + // Code size 31 (0x1f) + .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_000b: stloc.0 - IL_000c: ldloc.0 - IL_000d: ldc.i4.s 10 - IL_000f: newarr [mscorlib]System.Int32 - IL_0014: stloc.1 - IL_0015: ldloc.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.1 - IL_0018: stelem.i4 - IL_0019: ldloc.1 - IL_001a: ldc.i4.1 - IL_001b: ldc.i4.2 - IL_001c: stelem.i4 - IL_001d: ldloc.1 - IL_001e: ldc.i4.2 - IL_001f: ldc.i4.3 - IL_0020: stelem.i4 - IL_0021: ldloc.1 - IL_0022: ldc.i4.3 - IL_0023: ldc.i4.4 - IL_0024: stelem.i4 - IL_0025: ldloc.1 - IL_0026: ldc.i4.4 - IL_0027: ldc.i4.5 - IL_0028: stelem.i4 - IL_0029: ldloc.1 - IL_002a: ldc.i4.5 - IL_002b: ldc.i4.6 - IL_002c: stelem.i4 - IL_002d: ldloc.1 - IL_002e: ldc.i4.6 - IL_002f: ldc.i4.7 - IL_0030: stelem.i4 - IL_0031: ldloc.1 - IL_0032: ldc.i4.7 - IL_0033: ldc.i4.8 - IL_0034: stelem.i4 - IL_0035: ldloc.1 - IL_0036: ldc.i4.8 - IL_0037: ldc.i4.s 9 - IL_0039: stelem.i4 - IL_003a: ldloc.1 - IL_003b: ldc.i4.s 9 - IL_003d: ldc.i4.s 10 - IL_003f: stelem.i4 - IL_0040: ldloc.1 - IL_0041: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) - IL_0046: nop - IL_0047: ldloc.0 - IL_0048: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: ldc.i4.s 10 + IL_0008: newarr [mscorlib]System.Byte + IL_000d: dup + IL_000e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=10' ''::'$$method0x6000010-1' + IL_0013: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_004d: nop - IL_004e: ret - } // end of method TestCases::CollectionInitializerWithParamsMethod + IL_001d: nop + IL_001e: ret + } // end of method TestCases::ArrayByte - .method public hidebysig static void CollectionInitializerList() cil managed + .method public hidebysig static void ArraySByte() cil managed { - // Code size 44 (0x2c) - .maxstack 3 - .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) + // Code size 30 (0x1e) + .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000b: stloc.0 - IL_000c: ldloc.0 - IL_000d: ldc.i4.1 - IL_000e: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0013: nop - IL_0014: ldloc.0 - IL_0015: ldc.i4.2 - IL_0016: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001b: nop - IL_001c: ldloc.0 - IL_001d: ldc.i4.3 - IL_001e: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0023: nop - IL_0024: ldloc.0 - IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: ldc.i4.8 + IL_0007: newarr [mscorlib]System.SByte + IL_000c: dup + IL_000d: ldtoken field int64 ''::'$$method0x6000011-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002a: nop - IL_002b: ret - } // end of method TestCases::CollectionInitializerList + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArraySByte - .method public hidebysig static object - RecursiveCollectionInitializer() cil managed + .method public hidebysig static void ArrayShort() cil managed { - // Code size 21 (0x15) - .maxstack 2 - .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0, - object V_1) + // Code size 30 (0x1e) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldloc.0 - IL_0009: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_000e: nop - IL_000f: ldloc.0 - IL_0010: stloc.1 - IL_0011: br.s IL_0013 - - IL_0013: ldloc.1 - IL_0014: ret - } // end of method TestCases::RecursiveCollectionInitializer + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.5 + IL_0007: newarr [mscorlib]System.Int16 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=10' ''::'$$method0x6000012-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayShort - .method public hidebysig static void CollectionInitializerDictionary() cil managed + .method public hidebysig static void ArrayUShort() cil managed { - // Code size 59 (0x3b) - .maxstack 4 - .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) + // Code size 30 (0x1e) + .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() - IL_000b: stloc.0 - IL_000c: ldloc.0 - IL_000d: ldstr "First" - IL_0012: ldc.i4.1 - IL_0013: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0018: nop - IL_0019: ldloc.0 - IL_001a: ldstr "Second" - IL_001f: ldc.i4.2 - IL_0020: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0025: nop - IL_0026: ldloc.0 - IL_0027: ldstr "Third" - IL_002c: ldc.i4.3 - IL_002d: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0032: nop - IL_0033: ldloc.0 - IL_0034: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: ldc.i4.6 + IL_0007: newarr [mscorlib]System.UInt16 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=12' ''::'$$method0x6000013-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0039: nop - IL_003a: ret - } // end of method TestCases::CollectionInitializerDictionary + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayUShort - .method public hidebysig static void CollectionInitializerDictionaryWithEnumTypes() cil managed + .method public hidebysig static void ArrayInt() cil managed { - // Code size 38 (0x26) - .maxstack 4 - .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) + // Code size 31 (0x1f) + .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() - IL_000b: stloc.0 - IL_000c: ldloc.0 - IL_000d: ldc.i4.0 - IL_000e: ldc.i4.0 - IL_000f: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0014: nop - IL_0015: ldloc.0 - IL_0016: ldc.i4.1 - IL_0017: ldc.i4.1 - IL_0018: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) + IL_0006: ldc.i4.s 10 + IL_0008: newarr [mscorlib]System.Int32 + IL_000d: dup + IL_000e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'$$method0x6000014-1' + IL_0013: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) IL_001d: nop - IL_001e: ldloc.0 - IL_001f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_001e: ret + } // end of method TestCases::ArrayInt + + .method public hidebysig static void ArrayUInt() cil managed + { + // Code size 31 (0x1f) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.s 10 + IL_0008: newarr [mscorlib]System.UInt32 + IL_000d: dup + IL_000e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'$$method0x6000015-1' + IL_0013: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0024: nop - IL_0025: ret - } // end of method TestCases::CollectionInitializerDictionaryWithEnumTypes + IL_001d: nop + IL_001e: ret + } // end of method TestCases::ArrayUInt - .method public hidebysig static void NotACollectionInitializer() cil managed + .method public hidebysig static void ArrayLong() cil managed { - // Code size 44 (0x2c) - .maxstack 2 - .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) + // Code size 30 (0x1e) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.1 - IL_0009: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_000e: nop - IL_000f: ldloc.0 - IL_0010: ldc.i4.2 - IL_0011: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0016: nop - IL_0017: ldloc.0 - IL_0018: ldc.i4.3 - IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001e: nop - IL_001f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0024: ldloc.0 - IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.5 + IL_0007: newarr [mscorlib]System.Int64 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'$$method0x6000016-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002a: nop + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayLong + + .method public hidebysig static void ArrayULong() cil managed + { + // Code size 31 (0x1f) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.s 10 + IL_0008: newarr [mscorlib]System.UInt64 + IL_000d: dup + IL_000e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=80' ''::'$$method0x6000017-1' + IL_0013: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001d: nop + IL_001e: ret + } // end of method TestCases::ArrayULong + + .method public hidebysig static void ArrayFloat() cil managed + { + // Code size 30 (0x1e) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.6 + IL_0007: newarr [mscorlib]System.Single + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=24' ''::'$$method0x6000018-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayFloat + + .method public hidebysig static void ArrayDouble() cil managed + { + // Code size 30 (0x1e) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.6 + IL_0007: newarr [mscorlib]System.Double + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=48' ''::'$$method0x6000019-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayDouble + + .method public hidebysig static void ArrayDecimal() cil managed + { + // Code size 129 (0x81) + .maxstack 7 + .locals init (valuetype [mscorlib]System.Decimal[] V_0) + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.6 + IL_0007: newarr [mscorlib]System.Decimal + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.0 + IL_000f: ldelema [mscorlib]System.Decimal + IL_0014: ldc.i4.s -100 + IL_0016: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_001b: stobj [mscorlib]System.Decimal + IL_0020: ldloc.0 + IL_0021: ldc.i4.2 + IL_0022: ldelema [mscorlib]System.Decimal + IL_0027: ldc.i4.s 100 + IL_0029: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_002e: stobj [mscorlib]System.Decimal + IL_0033: ldloc.0 + IL_0034: ldc.i4.3 + IL_0035: ldelema [mscorlib]System.Decimal + IL_003a: ldc.i4.m1 + IL_003b: ldc.i4.m1 + IL_003c: ldc.i4.m1 + IL_003d: ldc.i4 0x80 + IL_0042: ldc.i4.0 + IL_0043: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_0048: stobj [mscorlib]System.Decimal + IL_004d: ldloc.0 + IL_004e: ldc.i4.4 + IL_004f: ldelema [mscorlib]System.Decimal + IL_0054: ldc.i4.m1 + IL_0055: ldc.i4.m1 + IL_0056: ldc.i4.m1 + IL_0057: ldc.i4.0 + IL_0058: ldc.i4.0 + IL_0059: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_005e: stobj [mscorlib]System.Decimal + IL_0063: ldloc.0 + IL_0064: ldc.i4.5 + IL_0065: ldelema [mscorlib]System.Decimal + IL_006a: ldc.i4.1 + IL_006b: ldc.i4.0 + IL_006c: ldc.i4.0 + IL_006d: ldc.i4.0 + IL_006e: ldc.i4.7 + IL_006f: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_0074: stobj [mscorlib]System.Decimal + IL_0079: ldloc.0 + IL_007a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_007f: nop + IL_0080: ret + } // end of method TestCases::ArrayDecimal + + .method public hidebysig static void ArrayString() cil managed + { + // Code size 45 (0x2d) + .maxstack 4 + .locals init (string[] V_0) + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.4 + IL_0007: newarr [mscorlib]System.String + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.0 + IL_000f: ldstr "" + IL_0014: stelem.ref + IL_0015: ldloc.0 + IL_0016: ldc.i4.2 + IL_0017: ldstr "Hello" + IL_001c: stelem.ref + IL_001d: ldloc.0 + IL_001e: ldc.i4.3 + IL_001f: ldstr "World" + IL_0024: stelem.ref + IL_0025: ldloc.0 + IL_0026: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002b: nop + IL_002c: ret + } // end of method TestCases::ArrayString + + .method public hidebysig static void ArrayEnum() cil managed + { + // Code size 29 (0x1d) + .maxstack 4 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum[] V_0) + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.4 + IL_0007: newarr ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.1 + IL_000f: ldc.i4.1 + IL_0010: stelem.i4 + IL_0011: ldloc.0 + IL_0012: ldc.i4.3 + IL_0013: ldc.i4.1 + IL_0014: stelem.i4 + IL_0015: ldloc.0 + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001b: nop + IL_001c: ret + } // end of method TestCases::ArrayEnum + + .method public hidebysig static void RecursiveArrayInitializer() cil managed + { + // Code size 29 (0x1d) + .maxstack 4 + .locals init (int32[] V_0) + IL_0000: nop + IL_0001: ldc.i4.3 + IL_0002: newarr [mscorlib]System.Int32 + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.0 + IL_000a: ldc.i4.1 + IL_000b: stelem.i4 + IL_000c: ldloc.0 + IL_000d: ldc.i4.1 + IL_000e: ldc.i4.2 + IL_000f: stelem.i4 + IL_0010: ldloc.0 + IL_0011: ldc.i4.2 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: ldelem.i4 + IL_0015: ldc.i4.1 + IL_0016: add + IL_0017: stelem.i4 + IL_0018: ldloc.0 + IL_0019: ldc.i4.0 + IL_001a: ldc.i4.0 + IL_001b: stelem.i4 + IL_001c: ret + } // end of method TestCases::RecursiveArrayInitializer + + .method public hidebysig static void InvalidIndices(int32 a) cil managed + { + // Code size 25 (0x19) + .maxstack 3 + .locals init (int32[] V_0) + IL_0000: nop + IL_0001: ldc.i4.1 + IL_0002: newarr [mscorlib]System.Int32 + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: ldarg.0 + IL_000b: stelem.i4 + IL_000c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0011: ldloc.0 + IL_0012: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0017: nop + IL_0018: ret + } // end of method TestCases::InvalidIndices + + .method public hidebysig static void InvalidIndices2(int32 a) cil managed + { + // Code size 25 (0x19) + .maxstack 3 + .locals init (int32[] V_0) + IL_0000: nop + IL_0001: ldc.i4.1 + IL_0002: newarr [mscorlib]System.Int32 + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.m1 + IL_000a: ldarg.0 + IL_000b: stelem.i4 + IL_000c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0011: ldloc.0 + IL_0012: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0017: nop + IL_0018: ret + } // end of method TestCases::InvalidIndices2 + + .method public hidebysig static void IndicesInWrongOrder(int32 a, + int32 b) cil managed + { + // Code size 29 (0x1d) + .maxstack 3 + .locals init (int32[] V_0) + IL_0000: nop + IL_0001: ldc.i4.5 + IL_0002: newarr [mscorlib]System.Int32 + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.2 + IL_000a: ldarg.1 + IL_000b: stelem.i4 + IL_000c: ldloc.0 + IL_000d: ldc.i4.1 + IL_000e: ldarg.0 + IL_000f: stelem.i4 + IL_0010: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0015: ldloc.0 + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001b: nop + IL_001c: ret + } // end of method TestCases::IndicesInWrongOrder + + .method public hidebysig static void Issue953_MissingNullableSpecifierForArrayInitializer() cil managed + { + // Code size 38 (0x26) + .maxstack 2 + .locals init (valuetype [mscorlib]System.Nullable`1[] V_0) + IL_0000: nop + IL_0001: ldc.i4.1 + IL_0002: newarr valuetype [mscorlib]System.Nullable`1 + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.0 + IL_000a: ldelema valuetype [mscorlib]System.Nullable`1 + IL_000f: ldsfld valuetype [mscorlib]System.Guid [mscorlib]System.Guid::Empty + IL_0014: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0019: stobj valuetype [mscorlib]System.Nullable`1 + IL_001e: ldloc.0 + IL_001f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::NoOp(valuetype [mscorlib]System.Nullable`1[]) + IL_0024: nop + IL_0025: ret + } // end of method TestCases::Issue953_MissingNullableSpecifierForArrayInitializer + + .method private hidebysig instance void + Issue907_Test3(string text) cil managed + { + // Code size 33 (0x21) + .maxstack 4 + .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldstr "" + IL_0012: ldarg.1 + IL_0013: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0018: nop + IL_0019: ldloc.0 + IL_001a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001f: nop + IL_0020: ret + } // end of method TestCases::Issue907_Test3 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test1() cil managed + { + // Code size 42 (0x2a) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000d: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_0012: ldloc.0 + IL_0013: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_0018: ldc.i4.1 + IL_0019: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_001e: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.0 + IL_0025: stloc.1 + IL_0026: br.s IL_0028 + + IL_0028: ldloc.1 + IL_0029: ret + } // end of method TestCases::Test1 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test1Alternative() cil managed + { + // Code size 45 (0x2d) + .maxstack 4 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class [mscorlib]System.Collections.Generic.List`1 V_1, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_2) + IL_0000: nop + IL_0001: ldc.i4.1 + IL_0002: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000e: stloc.1 + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_0016: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001b: nop + IL_001c: ldloc.1 + IL_001d: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_0022: ldloc.0 + IL_0023: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) + IL_0028: stloc.2 + IL_0029: br.s IL_002b + + IL_002b: ldloc.2 + IL_002c: ret + } // end of method TestCases::Test1Alternative + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test2() cil managed + { + // Code size 27 (0x1b) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.1 + IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_000e: ldloc.0 + IL_000f: ldc.i4.2 + IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_0015: ldloc.0 + IL_0016: stloc.1 + IL_0017: br.s IL_0019 + + IL_0019: ldloc.1 + IL_001a: ret + } // end of method TestCases::Test2 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test3() cil managed + { + // Code size 37 (0x25) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.1 + IL_0009: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_000e: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0013: ldloc.0 + IL_0014: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0019: ldc.i4.2 + IL_001a: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_001f: ldloc.0 + IL_0020: stloc.1 + IL_0021: br.s IL_0023 + + IL_0023: ldloc.1 + IL_0024: ret + } // end of method TestCases::Test3 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test3b() cil managed + { + // Code size 38 (0x26) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + IL_0000: nop + IL_0001: ldc.i4.0 + IL_0002: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_000f: ldloc.0 + IL_0010: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0015: ldc.i4.2 + IL_0016: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_001b: ldloc.0 + IL_001c: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) + IL_0021: stloc.1 + IL_0022: br.s IL_0024 + + IL_0024: ldloc.1 + IL_0025: ret + } // end of method TestCases::Test3b + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test4() cil managed + { + // Code size 44 (0x2c) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_000d: ldc.i4.1 + IL_000e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_0013: ldloc.0 + IL_0014: ldc.i4.2 + IL_0015: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_001a: ldloc.0 + IL_001b: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0020: ldc.i4.3 + IL_0021: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::B + IL_0026: ldloc.0 + IL_0027: stloc.1 + IL_0028: br.s IL_002a + + IL_002a: ldloc.1 IL_002b: ret - } // end of method TestCases::NotACollectionInitializer + } // end of method TestCases::Test4 .method public hidebysig static void ObjectInitializer() cil managed { @@ -1854,18 +2397,18 @@ IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() IL_0006: stloc.0 IL_0007: ldloc.0 - IL_0008: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate9' + IL_0008: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate6' IL_000d: brtrue.s IL_0022 IL_000f: ldnull - IL_0010: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'b__8'(object, + IL_0010: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'b__5'(object, class [mscorlib]System.EventArgs) IL_0016: newobj instance void [mscorlib]System.EventHandler::.ctor(object, native int) - IL_001b: stsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate9' + IL_001b: stsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate6' IL_0020: br.s IL_0022 - IL_0022: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate9' + IL_0022: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate6' IL_0027: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) IL_002c: nop IL_002d: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() @@ -2032,44 +2575,6 @@ IL_0032: ret } // end of method TestCases::ObjectInitializerWithInitializationOfNestedObjects - .method private hidebysig static int32 - GetInt() cil managed - { - // Code size 7 (0x7) - .maxstack 1 - .locals init (int32 V_0) - IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: stloc.0 - IL_0003: br.s IL_0005 - - IL_0005: ldloc.0 - IL_0006: ret - } // end of method TestCases::GetInt - - .method private hidebysig static string - GetString() cil managed - { - // Code size 11 (0xb) - .maxstack 1 - .locals init (string V_0) - IL_0000: nop - IL_0001: ldstr "Test" - IL_0006: stloc.0 - IL_0007: br.s IL_0009 - - IL_0009: ldloc.0 - IL_000a: ret - } // end of method TestCases::GetString - - .method private hidebysig static void NoOp(valuetype [mscorlib]System.Nullable`1[] 'array') cil managed - { - // Code size 2 (0x2) - .maxstack 8 - IL_0000: nop - IL_0001: ret - } // end of method TestCases::NoOp - .method public hidebysig static void ObjectInitializerWithInitializationOfDeeplyNestedObjects() cil managed { // Code size 84 (0x54) @@ -2308,7 +2813,7 @@ IL_0035: ret } // end of method TestCases::StructInitializerWithinObjectInitializer - .method public hidebysig static void Bug270_NestedInitialisers() cil managed + .method public hidebysig static void Issue270_NestedInitialisers() cil managed { // Code size 128 (0x80) .maxstack 6 @@ -2321,7 +2826,7 @@ IL_0002: stloc.0 IL_0003: ldc.i4.0 IL_0004: ldnull - IL_0005: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Bug270_NestedInitialisers() + IL_0005: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Issue270_NestedInitialisers() IL_000b: newobj instance void [mscorlib]System.Threading.ThreadStart::.ctor(object, native int) IL_0010: newobj instance void [mscorlib]System.Threading.Thread::.ctor(class [mscorlib]System.Threading.ThreadStart) @@ -2346,17 +2851,17 @@ IL_003f: nop IL_0040: ldloc.2 IL_0041: ldloc.0 - IL_0042: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1d' + IL_0042: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1a' IL_0047: brtrue.s IL_005c IL_0049: ldnull - IL_004a: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'b__1c'(class [mscorlib]System.Globalization.NumberFormatInfo) + IL_004a: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'b__19'(class [mscorlib]System.Globalization.NumberFormatInfo) IL_0050: newobj instance void class [mscorlib]System.Func`2::.ctor(object, native int) - IL_0055: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1d' + IL_0055: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1a' IL_005a: br.s IL_005c - IL_005c: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1d' + IL_005c: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1a' IL_0061: call class [mscorlib]System.Collections.Generic.IEnumerable`1 [System.Core]System.Linq.Enumerable::Where(class [mscorlib]System.Collections.Generic.IEnumerable`1, class [mscorlib]System.Func`2) IL_0066: call !!0 [System.Core]System.Linq.Enumerable::First(class [mscorlib]System.Collections.Generic.IEnumerable`1) @@ -2370,51 +2875,57 @@ class [mscorlib]System.Threading.Thread) IL_007e: nop IL_007f: ret - } // end of method TestCases::Bug270_NestedInitialisers + } // end of method TestCases::Issue270_NestedInitialisers - .method public hidebysig static void Bug953_MissingNullableSpecifierForArrayInitializer() cil managed + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 + Issue1345() cil managed { - // Code size 38 (0x26) + // Code size 36 (0x24) .maxstack 2 - .locals init (valuetype [mscorlib]System.Nullable`1[] V_0) + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_1) IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: newarr valuetype [mscorlib]System.Nullable`1 - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldc.i4.0 - IL_000a: ldelema valuetype [mscorlib]System.Nullable`1 - IL_000f: ldsfld valuetype [mscorlib]System.Guid [mscorlib]System.Guid::Empty - IL_0014: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0019: stobj valuetype [mscorlib]System.Nullable`1 + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::Data + IL_000d: ldc.i4.3 + IL_000e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_001d: nop IL_001e: ldloc.0 - IL_001f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::NoOp(valuetype [mscorlib]System.Nullable`1[]) - IL_0024: nop - IL_0025: ret - } // end of method TestCases::Bug953_MissingNullableSpecifierForArrayInitializer + IL_001f: stloc.1 + IL_0020: br.s IL_0022 - .method private hidebysig instance void - Issue907_Test3(string text) cil managed + IL_0022: ldloc.1 + IL_0023: ret + } // end of method TestCases::Issue1345 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 + Issue1345b() cil managed { - // Code size 33 (0x21) - .maxstack 4 - .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) + // Code size 36 (0x24) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_1) IL_0000: nop - IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() - IL_000b: stloc.0 - IL_000c: ldloc.0 - IL_000d: ldstr "" - IL_0012: ldarg.1 - IL_0013: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0018: nop - IL_0019: ldloc.0 - IL_001a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_001f: nop - IL_0020: ret - } // end of method TestCases::Issue907_Test3 + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data2() + IL_000d: ldc.i4.3 + IL_000e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_001d: nop + IL_001e: ldloc.0 + IL_001f: stloc.1 + IL_0020: br.s IL_0022 + + IL_0022: ldloc.1 + IL_0023: ret + } // end of method TestCases::Issue1345b .method private hidebysig instance void Issue1250_Test1(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum 'value') cil managed @@ -2504,111 +3015,304 @@ IL_00a1: ret } // end of method TestCases::Issue1251_Test - .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data - Issue1279(int32 p) cil managed + .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data + Issue1279(int32 p) cil managed + { + // Code size 56 (0x38) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_1, + bool V_2) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldc.i4.1 + IL_0003: ceq + IL_0005: ldc.i4.0 + IL_0006: ceq + IL_0008: stloc.2 + IL_0009: ldloc.2 + IL_000a: brtrue.s IL_0032 + + IL_000c: nop + IL_000d: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: ldc.i4.0 + IL_0015: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_001a: nop + IL_001b: ldloc.0 + IL_001c: ldarg.0 + IL_001d: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Data_TestEvent(object, + class [mscorlib]System.EventArgs) + IL_0023: newobj instance void [mscorlib]System.EventHandler::.ctor(object, + native int) + IL_0028: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) + IL_002d: nop + IL_002e: ldloc.0 + IL_002f: stloc.1 + IL_0030: br.s IL_0036 + + IL_0032: ldnull + IL_0033: stloc.1 + IL_0034: br.s IL_0036 + + IL_0036: ldloc.1 + IL_0037: ret + } // end of method TestCases::Issue1279 + + .method public hidebysig static void ExtensionMethodInCollectionInitializer() cil managed + { + // Code size 43 (0x2b) + .maxstack 4 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0, + int32[] V_1) + IL_0000: nop + IL_0001: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.2 + IL_0009: newarr [mscorlib]System.Int32 + IL_000e: stloc.1 + IL_000f: ldloc.1 + IL_0010: ldc.i4.0 + IL_0011: ldc.i4.1 + IL_0012: stelem.i4 + IL_0013: ldloc.1 + IL_0014: ldc.i4.1 + IL_0015: ldc.i4.2 + IL_0016: stelem.i4 + IL_0017: ldloc.1 + IL_0018: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) + IL_001d: nop + IL_001e: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0023: ldloc.0 + IL_0024: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0029: nop + IL_002a: ret + } // end of method TestCases::ExtensionMethodInCollectionInitializer + + .method public hidebysig static void NoCollectionInitializerBecauseOfTypeArguments() cil managed + { + // Code size 27 (0x1b) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) + IL_0000: nop + IL_0001: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldstr "int" + IL_000d: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(string) + IL_0012: nop + IL_0013: ldloc.0 + IL_0014: call void [mscorlib]System.Console::WriteLine(object) + IL_0019: nop + IL_001a: ret + } // end of method TestCases::NoCollectionInitializerBecauseOfTypeArguments + + .method public hidebysig static void CollectionInitializerWithParamsMethod() cil managed + { + // Code size 79 (0x4f) + .maxstack 5 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0, + int32[] V_1) + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.s 10 + IL_000f: newarr [mscorlib]System.Int32 + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: ldc.i4.0 + IL_0017: ldc.i4.1 + IL_0018: stelem.i4 + IL_0019: ldloc.1 + IL_001a: ldc.i4.1 + IL_001b: ldc.i4.2 + IL_001c: stelem.i4 + IL_001d: ldloc.1 + IL_001e: ldc.i4.2 + IL_001f: ldc.i4.3 + IL_0020: stelem.i4 + IL_0021: ldloc.1 + IL_0022: ldc.i4.3 + IL_0023: ldc.i4.4 + IL_0024: stelem.i4 + IL_0025: ldloc.1 + IL_0026: ldc.i4.4 + IL_0027: ldc.i4.5 + IL_0028: stelem.i4 + IL_0029: ldloc.1 + IL_002a: ldc.i4.5 + IL_002b: ldc.i4.6 + IL_002c: stelem.i4 + IL_002d: ldloc.1 + IL_002e: ldc.i4.6 + IL_002f: ldc.i4.7 + IL_0030: stelem.i4 + IL_0031: ldloc.1 + IL_0032: ldc.i4.7 + IL_0033: ldc.i4.8 + IL_0034: stelem.i4 + IL_0035: ldloc.1 + IL_0036: ldc.i4.8 + IL_0037: ldc.i4.s 9 + IL_0039: stelem.i4 + IL_003a: ldloc.1 + IL_003b: ldc.i4.s 9 + IL_003d: ldc.i4.s 10 + IL_003f: stelem.i4 + IL_0040: ldloc.1 + IL_0041: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) + IL_0046: nop + IL_0047: ldloc.0 + IL_0048: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_004d: nop + IL_004e: ret + } // end of method TestCases::CollectionInitializerWithParamsMethod + + .method public hidebysig static void CollectionInitializerList() cil managed { - // Code size 56 (0x38) + // Code size 44 (0x2c) .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_1, - bool V_2) + .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) IL_0000: nop - IL_0001: ldarg.1 - IL_0002: ldc.i4.1 - IL_0003: ceq - IL_0005: ldc.i4.0 - IL_0006: ceq - IL_0008: stloc.2 - IL_0009: ldloc.2 - IL_000a: brtrue.s IL_0032 - - IL_000c: nop - IL_000d: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0012: stloc.0 - IL_0013: ldloc.0 - IL_0014: ldc.i4.0 - IL_0015: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_001a: nop - IL_001b: ldloc.0 - IL_001c: ldarg.0 - IL_001d: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Data_TestEvent(object, - class [mscorlib]System.EventArgs) - IL_0023: newobj instance void [mscorlib]System.EventHandler::.ctor(object, - native int) - IL_0028: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) - IL_002d: nop - IL_002e: ldloc.0 - IL_002f: stloc.1 - IL_0030: br.s IL_0036 + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.1 + IL_000e: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0013: nop + IL_0014: ldloc.0 + IL_0015: ldc.i4.2 + IL_0016: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001b: nop + IL_001c: ldloc.0 + IL_001d: ldc.i4.3 + IL_001e: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.0 + IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002a: nop + IL_002b: ret + } // end of method TestCases::CollectionInitializerList - IL_0032: ldnull - IL_0033: stloc.1 - IL_0034: br.s IL_0036 + .method public hidebysig static object + RecursiveCollectionInitializer() cil managed + { + // Code size 21 (0x15) + .maxstack 2 + .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0, + object V_1) + IL_0000: nop + IL_0001: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldloc.0 + IL_0009: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000e: nop + IL_000f: ldloc.0 + IL_0010: stloc.1 + IL_0011: br.s IL_0013 - IL_0036: ldloc.1 - IL_0037: ret - } // end of method TestCases::Issue1279 + IL_0013: ldloc.1 + IL_0014: ret + } // end of method TestCases::RecursiveCollectionInitializer - .method private hidebysig instance void - Data_TestEvent(object sender, - class [mscorlib]System.EventArgs e) cil managed + .method public hidebysig static void CollectionInitializerDictionary() cil managed { - // Code size 7 (0x7) - .maxstack 8 + // Code size 59 (0x3b) + .maxstack 4 + .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) IL_0000: nop - IL_0001: newobj instance void [mscorlib]System.NotImplementedException::.ctor() - IL_0006: throw - } // end of method TestCases::Data_TestEvent + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldstr "First" + IL_0012: ldc.i4.1 + IL_0013: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0018: nop + IL_0019: ldloc.0 + IL_001a: ldstr "Second" + IL_001f: ldc.i4.2 + IL_0020: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0025: nop + IL_0026: ldloc.0 + IL_0027: ldstr "Third" + IL_002c: ldc.i4.3 + IL_002d: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0032: nop + IL_0033: ldloc.0 + IL_0034: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0039: nop + IL_003a: ret + } // end of method TestCases::CollectionInitializerDictionary - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 - Issue1345() cil managed + .method public hidebysig static void CollectionInitializerDictionaryWithEnumTypes() cil managed { - // Code size 36 (0x24) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_1) + // Code size 38 (0x26) + .maxstack 4 + .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::Data - IL_000d: ldc.i4.3 - IL_000e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) - IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.0 + IL_000e: ldc.i4.0 + IL_000f: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0014: nop + IL_0015: ldloc.0 + IL_0016: ldc.i4.1 + IL_0017: ldc.i4.1 + IL_0018: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) IL_001d: nop IL_001e: ldloc.0 - IL_001f: stloc.1 - IL_0020: br.s IL_0022 - - IL_0022: ldloc.1 - IL_0023: ret - } // end of method TestCases::Issue1345 + IL_001f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0024: nop + IL_0025: ret + } // end of method TestCases::CollectionInitializerDictionaryWithEnumTypes - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 - Issue1345b() cil managed + .method public hidebysig static void NotACollectionInitializer() cil managed { - // Code size 36 (0x24) + // Code size 44 (0x2c) .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_1) + .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + IL_0001: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() IL_0006: stloc.0 IL_0007: ldloc.0 - IL_0008: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data2() - IL_000d: ldc.i4.3 - IL_000e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) - IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) - IL_001d: nop - IL_001e: ldloc.0 - IL_001f: stloc.1 - IL_0020: br.s IL_0022 - - IL_0022: ldloc.1 - IL_0023: ret - } // end of method TestCases::Issue1345b + IL_0008: ldc.i4.1 + IL_0009: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000e: nop + IL_000f: ldloc.0 + IL_0010: ldc.i4.2 + IL_0011: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0016: nop + IL_0017: ldloc.0 + IL_0018: ldc.i4.3 + IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001e: nop + IL_001f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0024: ldloc.0 + IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002a: nop + IL_002b: ret + } // end of method TestCases::NotACollectionInitializer .method public hidebysig specialname rtspecialname instance void .ctor() cil managed @@ -2620,7 +3324,7 @@ IL_0006: ret } // end of method TestCases::.ctor - .method private hidebysig static void 'b__8'(object param0, + .method private hidebysig static void 'b__5'(object param0, class [mscorlib]System.EventArgs param1) cil managed { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -2630,9 +3334,9 @@ IL_0001: call void [mscorlib]System.Console::WriteLine() IL_0006: nop IL_0007: ret - } // end of method TestCases::'b__8' + } // end of method TestCases::'b__5' - .method private hidebysig static bool 'b__1c'(class [mscorlib]System.Globalization.NumberFormatInfo format) cil managed + .method private hidebysig static bool 'b__19'(class [mscorlib]System.Globalization.NumberFormatInfo format) cil managed { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 21 (0x15) @@ -2648,11 +3352,125 @@ IL_0013: ldloc.0 IL_0014: ret - } // end of method TestCases::'b__1c' + } // end of method TestCases::'b__19' } // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases +.class private auto ansi '' + extends [mscorlib]System.Object +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=40' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 40 + } // end of class '__StaticArrayInitTypeSize=40' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=24' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 24 + } // end of class '__StaticArrayInitTypeSize=24' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=10' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 10 + } // end of class '__StaticArrayInitTypeSize=10' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=12' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 12 + } // end of class '__StaticArrayInitTypeSize=12' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=80' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 80 + } // end of class '__StaticArrayInitTypeSize=80' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=48' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 48 + } // end of class '__StaticArrayInitTypeSize=48' + + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=40' '$$method0x600000a-1' at I_000020C0 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=40' '$$method0x600000c-1' at I_00002138 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=24' '$$method0x600000c-2' at I_00002160 + .field static assembly int64 '$$method0x600000f-1' at I_00002418 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=10' '$$method0x6000010-1' at I_00002440 + .field static assembly int64 '$$method0x6000011-1' at I_00002470 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=10' '$$method0x6000012-1' at I_00002498 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=12' '$$method0x6000013-1' at I_000024C8 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=40' '$$method0x6000014-1' at I_000024F8 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=40' '$$method0x6000015-1' at I_00002540 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=40' '$$method0x6000016-1' at I_00002588 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=80' '$$method0x6000017-1' at I_000025D0 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=24' '$$method0x6000018-1' at I_00002640 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=48' '$$method0x6000019-1' at I_00002678 +} // end of class '' + // ============================================================= +.data cil I_000020C0 = bytearray ( + 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 + 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_00002138 = bytearray ( + 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 + 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_00002160 = bytearray ( + 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 + 05 00 00 00 06 00 00 00) +.data cil I_00002418 = bytearray ( + 01 00 01 00 00 00 01 01) +.data cil I_00002420 = int8[32] +.data cil I_00002440 = bytearray ( + 01 02 03 04 05 06 07 08 FE FF) +.data cil I_0000244A = int8[6] +.data cil I_00002470 = bytearray ( + 80 81 00 01 02 03 04 7F) +.data cil I_00002498 = bytearray ( + 00 80 FF FF 00 00 01 00 FF 7F) +.data cil I_000024A2 = int8[6] +.data cil I_000024C8 = bytearray ( + 00 00 01 00 FF 7F 00 80 FE FF FF FF) +.data cil I_000024D4 = int8[4] +.data cil I_000024F8 = bytearray ( + 01 00 00 00 FE FF FF FF 00 94 35 77 04 00 00 00 // ..........5w.... + 05 00 00 00 FA FF FF FF 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_00002520 = int8[32] +.data cil I_00002540 = bytearray ( + 01 00 00 00 00 94 35 77 00 5E D0 B2 04 00 00 00 // ......5w.^...... + 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_00002588 = bytearray ( + 01 00 0C BB 7D 6E 9C BA FF FF FF FF FF FF FF FF // ....}n.......... + 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 + FF FF F3 44 82 91 63 45) // ...D..cE +.data cil I_000025D0 = bytearray ( + 01 00 00 00 00 00 00 00 00 94 35 77 00 00 00 00 // ..........5w.... + 00 5E D0 B2 00 00 00 00 04 00 00 00 00 00 00 00 // .^.............. + 05 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 + 07 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 + FF FF F3 44 82 91 63 45 FF FF E7 89 04 23 C7 8A) // ...D..cE.....#.. +.data cil I_00002620 = int8[32] +.data cil I_00002640 = bytearray ( + 00 00 C0 BF 00 00 00 00 00 00 C0 3F 00 00 80 FF // ...........?.... + 00 00 80 7F 00 00 C0 FF) +.data cil I_00002678 = bytearray ( + 00 00 00 00 00 00 F8 BF 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 F8 3F 00 00 00 00 00 00 F0 FF // .......?........ + 00 00 00 00 00 00 F0 7F 00 00 00 00 00 00 F8 FF) // *********** DISASSEMBLY COMPLETE *********************** diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.il index 0a674783e..dd0f47ce1 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.il @@ -1109,9 +1109,9 @@ } // end of property OtherItem2::Data2 } // end of class OtherItem2 - .field private static class [mscorlib]System.EventHandler 'CS$<>9__CachedAnonymousMethodDelegate9' + .field private static class [mscorlib]System.EventHandler 'CS$<>9__CachedAnonymousMethodDelegate6' .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .field private static class [mscorlib]System.Func`2 'CS$<>9__CachedAnonymousMethodDelegate1d' + .field private static class [mscorlib]System.Func`2 'CS$<>9__CachedAnonymousMethodDelegate1a' .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .method private hidebysig static void X(object a, object b) cil managed @@ -1148,1082 +1148,1753 @@ IL_0001: ret } // end of method TestCases::TestCall - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test1() cil managed - { - // Code size 36 (0x24) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000c: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_0011: ldloc.0 - IL_0012: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_0017: ldc.i4.1 - IL_0018: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_001d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0022: ldloc.0 - IL_0023: ret - } // end of method TestCases::Test1 - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test1Alternative() cil managed + .method private hidebysig static int32 + GetInt() cil managed { - // Code size 39 (0x27) - .maxstack 4 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class [mscorlib]System.Collections.Generic.List`1 V_1) + // Code size 2 (0x2) + .maxstack 8 IL_0000: ldc.i4.1 - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000d: stloc.1 - IL_000e: ldloc.1 - IL_000f: ldc.i4.1 - IL_0010: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_0015: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001a: ldloc.1 - IL_001b: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_0020: ldloc.0 - IL_0021: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) - IL_0026: ret - } // end of method TestCases::Test1Alternative - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test2() cil managed - { - // Code size 22 (0x16) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldc.i4.1 - IL_0008: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_000d: ldloc.0 - IL_000e: ldc.i4.2 - IL_000f: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_0014: ldloc.0 - IL_0015: ret - } // end of method TestCases::Test2 + IL_0001: ret + } // end of method TestCases::GetInt - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test3() cil managed + .method private hidebysig static string + GetString() cil managed { - // Code size 32 (0x20) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldc.i4.1 - IL_0008: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_000d: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0012: ldloc.0 - IL_0013: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0018: ldc.i4.2 - IL_0019: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_001e: ldloc.0 - IL_001f: ret - } // end of method TestCases::Test3 + // Code size 6 (0x6) + .maxstack 8 + IL_0000: ldstr "Test" + IL_0005: ret + } // end of method TestCases::GetString - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test3b() cil managed + .method private hidebysig static void NoOp(valuetype [mscorlib]System.Nullable`1[] 'array') cil managed { - // Code size 33 (0x21) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) - IL_0000: ldc.i4.0 - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.1 - IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_000e: ldloc.0 - IL_000f: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0014: ldc.i4.2 - IL_0015: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_001a: ldloc.0 - IL_001b: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) - IL_0020: ret - } // end of method TestCases::Test3b + // Code size 1 (0x1) + .maxstack 8 + IL_0000: ret + } // end of method TestCases::NoOp - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test4() cil managed + .method private hidebysig instance void + Data_TestEvent(object sender, + class [mscorlib]System.EventArgs e) cil managed { - // Code size 39 (0x27) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_000c: ldc.i4.1 - IL_000d: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_0012: ldloc.0 - IL_0013: ldc.i4.2 - IL_0014: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_0019: ldloc.0 - IL_001a: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_001f: ldc.i4.3 - IL_0020: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::B - IL_0025: ldloc.0 - IL_0026: ret - } // end of method TestCases::Test4 + // Code size 6 (0x6) + .maxstack 8 + IL_0000: newobj instance void [mscorlib]System.NotImplementedException::.ctor() + IL_0005: throw + } // end of method TestCases::Data_TestEvent - .method public hidebysig static void InvalidIndices(int32 a) cil managed + .method public hidebysig static void Array1() cil managed { - // Code size 23 (0x17) - .maxstack 3 - .locals init (int32[] V_0) - IL_0000: ldc.i4.1 - IL_0001: newarr [mscorlib]System.Int32 - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.1 - IL_0009: ldarg.0 - IL_000a: stelem.i4 - IL_000b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0010: ldloc.0 - IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + // Code size 29 (0x1d) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.s 10 + IL_0007: newarr [mscorlib]System.Int32 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'$$method0x600000a-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0016: ret - } // end of method TestCases::InvalidIndices + IL_001c: ret + } // end of method TestCases::Array1 - .method public hidebysig static void InvalidIndices2(int32 a) cil managed + .method public hidebysig static void Array2(int32 a, + int32 b, + int32 c) cil managed { - // Code size 23 (0x17) - .maxstack 3 + // Code size 31 (0x1f) + .maxstack 4 .locals init (int32[] V_0) - IL_0000: ldc.i4.1 - IL_0001: newarr [mscorlib]System.Int32 - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.m1 - IL_0009: ldarg.0 - IL_000a: stelem.i4 - IL_000b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.5 + IL_0006: newarr [mscorlib]System.Int32 + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.0 + IL_000e: ldarg.0 + IL_000f: stelem.i4 IL_0010: ldloc.0 - IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0016: ret - } // end of method TestCases::InvalidIndices2 - - .method public hidebysig static void IndicesInWrongOrder(int32 a, - int32 b) cil managed - { - // Code size 27 (0x1b) - .maxstack 3 - .locals init (int32[] V_0) - IL_0000: ldc.i4.5 - IL_0001: newarr [mscorlib]System.Int32 - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.2 - IL_0009: ldarg.1 - IL_000a: stelem.i4 - IL_000b: ldloc.0 - IL_000c: ldc.i4.1 - IL_000d: ldarg.0 - IL_000e: stelem.i4 - IL_000f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0011: ldc.i4.2 + IL_0012: ldarg.1 + IL_0013: stelem.i4 IL_0014: ldloc.0 - IL_0015: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0015: ldc.i4.4 + IL_0016: ldarg.2 + IL_0017: stelem.i4 + IL_0018: ldloc.0 + IL_0019: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_001a: ret - } // end of method TestCases::IndicesInWrongOrder + IL_001e: ret + } // end of method TestCases::Array2 - .method public hidebysig static void ExtensionMethodInCollectionInitializer() cil managed + .method public hidebysig static void NestedArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 40 (0x28) - .maxstack 4 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0, + // Code size 83 (0x53) + .maxstack 6 + .locals init (int32[][] V_0, int32[] V_1) - IL_0000: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldc.i4.2 - IL_0008: newarr [mscorlib]System.Int32 - IL_000d: stloc.1 - IL_000e: ldloc.1 - IL_000f: ldc.i4.0 - IL_0010: ldc.i4.1 - IL_0011: stelem.i4 - IL_0012: ldloc.1 - IL_0013: ldc.i4.1 - IL_0014: ldc.i4.2 - IL_0015: stelem.i4 - IL_0016: ldloc.1 - IL_0017: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) - IL_001c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.3 + IL_0006: newarr int32[] + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.0 + IL_000e: ldc.i4.s 10 + IL_0010: newarr [mscorlib]System.Int32 + IL_0015: dup + IL_0016: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'$$method0x600000c-1' + IL_001b: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0020: stelem.ref IL_0021: ldloc.0 - IL_0022: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0022: ldc.i4.1 + IL_0023: ldc.i4.3 + IL_0024: newarr [mscorlib]System.Int32 + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: ldarg.0 + IL_002d: stelem.i4 + IL_002e: ldloc.1 + IL_002f: ldc.i4.1 + IL_0030: ldarg.1 + IL_0031: stelem.i4 + IL_0032: ldloc.1 + IL_0033: ldc.i4.2 + IL_0034: ldarg.2 + IL_0035: stelem.i4 + IL_0036: ldloc.1 + IL_0037: stelem.ref + IL_0038: ldloc.0 + IL_0039: ldc.i4.2 + IL_003a: ldc.i4.6 + IL_003b: newarr [mscorlib]System.Int32 + IL_0040: dup + IL_0041: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=24' ''::'$$method0x600000c-2' + IL_0046: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_004b: stelem.ref + IL_004c: ldloc.0 + IL_004d: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0027: ret - } // end of method TestCases::ExtensionMethodInCollectionInitializer - - .method public hidebysig static void NoCollectionInitializerBecauseOfTypeArguments() cil managed - { - // Code size 24 (0x18) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) - IL_0000: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldstr "int" - IL_000c: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(string) - IL_0011: ldloc.0 - IL_0012: call void [mscorlib]System.Console::WriteLine(object) - IL_0017: ret - } // end of method TestCases::NoCollectionInitializerBecauseOfTypeArguments + IL_0052: ret + } // end of method TestCases::NestedArray - .method public hidebysig static void CollectionInitializerWithParamsMethod() cil managed + .method public hidebysig static void NestedNullableArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 76 (0x4c) + // Code size 473 (0x1d9) .maxstack 5 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0, - int32[] V_1) + .locals init (valuetype [mscorlib]System.Nullable`1[][] V_0, + valuetype [mscorlib]System.Nullable`1[] V_1, + valuetype [mscorlib]System.Nullable`1 V_2, + valuetype [mscorlib]System.Nullable`1[] V_3, + valuetype [mscorlib]System.Nullable`1 V_4, + valuetype [mscorlib]System.Nullable`1[] V_5, + valuetype [mscorlib]System.Nullable`1 V_6) IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldc.i4.s 10 - IL_000e: newarr [mscorlib]System.Int32 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: ldc.i4.0 - IL_0016: ldc.i4.1 - IL_0017: stelem.i4 - IL_0018: ldloc.1 - IL_0019: ldc.i4.1 - IL_001a: ldc.i4.2 - IL_001b: stelem.i4 - IL_001c: ldloc.1 - IL_001d: ldc.i4.2 - IL_001e: ldc.i4.3 - IL_001f: stelem.i4 - IL_0020: ldloc.1 - IL_0021: ldc.i4.3 - IL_0022: ldc.i4.4 - IL_0023: stelem.i4 - IL_0024: ldloc.1 - IL_0025: ldc.i4.4 - IL_0026: ldc.i4.5 - IL_0027: stelem.i4 + IL_0005: ldc.i4.3 + IL_0006: newarr valuetype [mscorlib]System.Nullable`1[] + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.0 + IL_000e: ldc.i4.s 11 + IL_0010: newarr valuetype [mscorlib]System.Nullable`1 + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.0 + IL_0018: ldelema valuetype [mscorlib]System.Nullable`1 + IL_001d: ldc.i4.1 + IL_001e: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0023: stobj valuetype [mscorlib]System.Nullable`1 IL_0028: ldloc.1 - IL_0029: ldc.i4.5 - IL_002a: ldc.i4.6 - IL_002b: stelem.i4 - IL_002c: ldloc.1 - IL_002d: ldc.i4.6 - IL_002e: ldc.i4.7 - IL_002f: stelem.i4 - IL_0030: ldloc.1 - IL_0031: ldc.i4.7 - IL_0032: ldc.i4.8 - IL_0033: stelem.i4 - IL_0034: ldloc.1 - IL_0035: ldc.i4.8 - IL_0036: ldc.i4.s 9 - IL_0038: stelem.i4 - IL_0039: ldloc.1 - IL_003a: ldc.i4.s 9 - IL_003c: ldc.i4.s 10 - IL_003e: stelem.i4 - IL_003f: ldloc.1 - IL_0040: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) - IL_0045: ldloc.0 - IL_0046: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0029: ldc.i4.1 + IL_002a: ldelema valuetype [mscorlib]System.Nullable`1 + IL_002f: ldc.i4.2 + IL_0030: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0035: stobj valuetype [mscorlib]System.Nullable`1 + IL_003a: ldloc.1 + IL_003b: ldc.i4.2 + IL_003c: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0041: ldc.i4.3 + IL_0042: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0047: stobj valuetype [mscorlib]System.Nullable`1 + IL_004c: ldloc.1 + IL_004d: ldc.i4.3 + IL_004e: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0053: ldc.i4.4 + IL_0054: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0059: stobj valuetype [mscorlib]System.Nullable`1 + IL_005e: ldloc.1 + IL_005f: ldc.i4.4 + IL_0060: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0065: ldc.i4.5 + IL_0066: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_006b: stobj valuetype [mscorlib]System.Nullable`1 + IL_0070: ldloc.1 + IL_0071: ldc.i4.5 + IL_0072: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0077: ldc.i4.6 + IL_0078: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_007d: stobj valuetype [mscorlib]System.Nullable`1 + IL_0082: ldloc.1 + IL_0083: ldc.i4.6 + IL_0084: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0089: ldc.i4.7 + IL_008a: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_008f: stobj valuetype [mscorlib]System.Nullable`1 + IL_0094: ldloc.1 + IL_0095: ldc.i4.7 + IL_0096: ldelema valuetype [mscorlib]System.Nullable`1 + IL_009b: ldc.i4.8 + IL_009c: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00a1: stobj valuetype [mscorlib]System.Nullable`1 + IL_00a6: ldloc.1 + IL_00a7: ldc.i4.8 + IL_00a8: ldelema valuetype [mscorlib]System.Nullable`1 + IL_00ad: ldc.i4.s 9 + IL_00af: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00b4: stobj valuetype [mscorlib]System.Nullable`1 + IL_00b9: ldloc.1 + IL_00ba: ldc.i4.s 9 + IL_00bc: ldelema valuetype [mscorlib]System.Nullable`1 + IL_00c1: ldc.i4.s 10 + IL_00c3: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00c8: stobj valuetype [mscorlib]System.Nullable`1 + IL_00cd: ldloc.1 + IL_00ce: ldc.i4.s 10 + IL_00d0: ldelema valuetype [mscorlib]System.Nullable`1 + IL_00d5: ldloca.s V_2 + IL_00d7: initobj valuetype [mscorlib]System.Nullable`1 + IL_00dd: ldloc.2 + IL_00de: stobj valuetype [mscorlib]System.Nullable`1 + IL_00e3: ldloc.1 + IL_00e4: stelem.ref + IL_00e5: ldloc.0 + IL_00e6: ldc.i4.1 + IL_00e7: ldc.i4.4 + IL_00e8: newarr valuetype [mscorlib]System.Nullable`1 + IL_00ed: stloc.3 + IL_00ee: ldloc.3 + IL_00ef: ldc.i4.0 + IL_00f0: ldelema valuetype [mscorlib]System.Nullable`1 + IL_00f5: ldarg.0 + IL_00f6: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00fb: stobj valuetype [mscorlib]System.Nullable`1 + IL_0100: ldloc.3 + IL_0101: ldc.i4.1 + IL_0102: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0107: ldarg.1 + IL_0108: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_010d: stobj valuetype [mscorlib]System.Nullable`1 + IL_0112: ldloc.3 + IL_0113: ldc.i4.2 + IL_0114: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0119: ldarg.2 + IL_011a: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_011f: stobj valuetype [mscorlib]System.Nullable`1 + IL_0124: ldloc.3 + IL_0125: ldc.i4.3 + IL_0126: ldelema valuetype [mscorlib]System.Nullable`1 + IL_012b: ldloca.s V_4 + IL_012d: initobj valuetype [mscorlib]System.Nullable`1 + IL_0133: ldloc.s V_4 + IL_0135: stobj valuetype [mscorlib]System.Nullable`1 + IL_013a: ldloc.3 + IL_013b: stelem.ref + IL_013c: ldloc.0 + IL_013d: ldc.i4.2 + IL_013e: ldc.i4.7 + IL_013f: newarr valuetype [mscorlib]System.Nullable`1 + IL_0144: stloc.s V_5 + IL_0146: ldloc.s V_5 + IL_0148: ldc.i4.0 + IL_0149: ldelema valuetype [mscorlib]System.Nullable`1 + IL_014e: ldc.i4.1 + IL_014f: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0154: stobj valuetype [mscorlib]System.Nullable`1 + IL_0159: ldloc.s V_5 + IL_015b: ldc.i4.1 + IL_015c: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0161: ldc.i4.2 + IL_0162: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0167: stobj valuetype [mscorlib]System.Nullable`1 + IL_016c: ldloc.s V_5 + IL_016e: ldc.i4.2 + IL_016f: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0174: ldc.i4.3 + IL_0175: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_017a: stobj valuetype [mscorlib]System.Nullable`1 + IL_017f: ldloc.s V_5 + IL_0181: ldc.i4.3 + IL_0182: ldelema valuetype [mscorlib]System.Nullable`1 + IL_0187: ldc.i4.4 + IL_0188: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_018d: stobj valuetype [mscorlib]System.Nullable`1 + IL_0192: ldloc.s V_5 + IL_0194: ldc.i4.4 + IL_0195: ldelema valuetype [mscorlib]System.Nullable`1 + IL_019a: ldc.i4.5 + IL_019b: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_01a0: stobj valuetype [mscorlib]System.Nullable`1 + IL_01a5: ldloc.s V_5 + IL_01a7: ldc.i4.5 + IL_01a8: ldelema valuetype [mscorlib]System.Nullable`1 + IL_01ad: ldc.i4.6 + IL_01ae: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_01b3: stobj valuetype [mscorlib]System.Nullable`1 + IL_01b8: ldloc.s V_5 + IL_01ba: ldc.i4.6 + IL_01bb: ldelema valuetype [mscorlib]System.Nullable`1 + IL_01c0: ldloca.s V_6 + IL_01c2: initobj valuetype [mscorlib]System.Nullable`1 + IL_01c8: ldloc.s V_6 + IL_01ca: stobj valuetype [mscorlib]System.Nullable`1 + IL_01cf: ldloc.s V_5 + IL_01d1: stelem.ref + IL_01d2: ldloc.0 + IL_01d3: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_004b: ret - } // end of method TestCases::CollectionInitializerWithParamsMethod + IL_01d8: ret + } // end of method TestCases::NestedNullableArray - .method public hidebysig static void CollectionInitializerList() cil managed + .method public hidebysig static void NestedPointerArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 39 (0x27) - .maxstack 3 - .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) + // Code size 82 (0x52) + .maxstack 6 + .locals init (void*[][] V_0, + void*[] V_1, + void*[] V_2, + void*[] V_3) IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldc.i4.1 - IL_000d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0012: ldloc.0 - IL_0013: ldc.i4.2 - IL_0014: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0019: ldloc.0 - IL_001a: ldc.i4.3 - IL_001b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0020: ldloc.0 - IL_0021: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.3 + IL_0006: newarr void*[] + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.0 + IL_000e: ldc.i4.1 + IL_000f: newarr void* + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: ldc.i4.0 + IL_0017: ldc.i4.0 + IL_0018: conv.u + IL_0019: stelem.i + IL_001a: ldloc.1 + IL_001b: stelem.ref + IL_001c: ldloc.0 + IL_001d: ldc.i4.1 + IL_001e: ldc.i4.2 + IL_001f: newarr void* + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: ldc.i4.0 + IL_0027: ldc.i4 0xc8 + IL_002c: conv.i + IL_002d: stelem.i + IL_002e: ldloc.2 + IL_002f: ldc.i4.1 + IL_0030: ldc.i4.0 + IL_0031: conv.u + IL_0032: stelem.i + IL_0033: ldloc.2 + IL_0034: stelem.ref + IL_0035: ldloc.0 + IL_0036: ldc.i4.2 + IL_0037: ldc.i4.2 + IL_0038: newarr void* + IL_003d: stloc.3 + IL_003e: ldloc.3 + IL_003f: ldc.i4.0 + IL_0040: ldc.i4.s 100 + IL_0042: conv.i + IL_0043: stelem.i + IL_0044: ldloc.3 + IL_0045: ldc.i4.1 + IL_0046: ldc.i4.0 + IL_0047: conv.u + IL_0048: stelem.i + IL_0049: ldloc.3 + IL_004a: stelem.ref + IL_004b: ldloc.0 + IL_004c: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0026: ret - } // end of method TestCases::CollectionInitializerList + IL_0051: ret + } // end of method TestCases::NestedPointerArray - .method public hidebysig static object - RecursiveCollectionInitializer() cil managed + .method public hidebysig static void ArrayBoolean() cil managed { - // Code size 15 (0xf) - .maxstack 2 - .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) - IL_0000: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldloc.0 - IL_0008: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_000d: ldloc.0 - IL_000e: ret - } // end of method TestCases::RecursiveCollectionInitializer + // Code size 28 (0x1c) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.8 + IL_0006: newarr [mscorlib]System.Boolean + IL_000b: dup + IL_000c: ldtoken field int64 ''::'$$method0x600000f-1' + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001b: ret + } // end of method TestCases::ArrayBoolean - .method public hidebysig static void CollectionInitializerDictionary() cil managed + .method public hidebysig static void ArrayByte() cil managed { - // Code size 54 (0x36) - .maxstack 4 - .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) + // Code size 29 (0x1d) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldstr "First" - IL_0011: ldc.i4.1 - IL_0012: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0017: ldloc.0 - IL_0018: ldstr "Second" - IL_001d: ldc.i4.2 - IL_001e: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0023: ldloc.0 - IL_0024: ldstr "Third" - IL_0029: ldc.i4.3 - IL_002a: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_002f: ldloc.0 - IL_0030: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.s 10 + IL_0007: newarr [mscorlib]System.Byte + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=10' ''::'$$method0x6000010-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0035: ret - } // end of method TestCases::CollectionInitializerDictionary + IL_001c: ret + } // end of method TestCases::ArrayByte - .method public hidebysig static void CollectionInitializerDictionaryWithEnumTypes() cil managed + .method public hidebysig static void ArraySByte() cil managed { - // Code size 34 (0x22) - .maxstack 4 - .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) + // Code size 28 (0x1c) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldc.i4.0 - IL_000d: ldc.i4.0 - IL_000e: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0013: ldloc.0 - IL_0014: ldc.i4.1 - IL_0015: ldc.i4.1 - IL_0016: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_001b: ldloc.0 - IL_001c: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.8 + IL_0006: newarr [mscorlib]System.SByte + IL_000b: dup + IL_000c: ldtoken field int64 ''::'$$method0x6000011-1' + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0021: ret - } // end of method TestCases::CollectionInitializerDictionaryWithEnumTypes + IL_001b: ret + } // end of method TestCases::ArraySByte - .method public hidebysig static void NotACollectionInitializer() cil managed + .method public hidebysig static void ArrayShort() cil managed { - // Code size 39 (0x27) - .maxstack 2 - .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) - IL_0000: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldc.i4.1 - IL_0008: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_000d: ldloc.0 - IL_000e: ldc.i4.2 - IL_000f: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0014: ldloc.0 - IL_0015: ldc.i4.3 - IL_0016: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0020: ldloc.0 - IL_0021: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + // Code size 28 (0x1c) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.5 + IL_0006: newarr [mscorlib]System.Int16 + IL_000b: dup + IL_000c: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=10' ''::'$$method0x6000012-1' + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0026: ret - } // end of method TestCases::NotACollectionInitializer + IL_001b: ret + } // end of method TestCases::ArrayShort - .method public hidebysig static void ObjectInitializer() cil managed + .method public hidebysig static void ArrayUShort() cil managed { - // Code size 25 (0x19) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + // Code size 28 (0x1c) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: ldloc.0 - IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.6 + IL_0006: newarr [mscorlib]System.UInt16 + IL_000b: dup + IL_000c: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=12' ''::'$$method0x6000013-1' + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0018: ret - } // end of method TestCases::ObjectInitializer + IL_001b: ret + } // end of method TestCases::ArrayUShort - .method public hidebysig static void NotAnObjectInitializer() cil managed + .method public hidebysig static void ArrayInt() cil managed { - // Code size 25 (0x19) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldc.i4.0 - IL_0008: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_000d: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0012: ldloc.0 - IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + // Code size 29 (0x1d) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.s 10 + IL_0007: newarr [mscorlib]System.Int32 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'$$method0x6000014-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0018: ret - } // end of method TestCases::NotAnObjectInitializer + IL_001c: ret + } // end of method TestCases::ArrayInt - .method public hidebysig static void NotAnObjectInitializerWithEvent() cil managed + .method public hidebysig static void ArrayUInt() cil managed { - // Code size 53 (0x35) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate9' - IL_000c: brtrue.s IL_001f + // Code size 29 (0x1d) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.s 10 + IL_0007: newarr [mscorlib]System.UInt32 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'$$method0x6000015-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001c: ret + } // end of method TestCases::ArrayUInt - IL_000e: ldnull - IL_000f: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'b__8'(object, - class [mscorlib]System.EventArgs) - IL_0015: newobj instance void [mscorlib]System.EventHandler::.ctor(object, - native int) - IL_001a: stsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate9' - IL_001f: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate9' - IL_0024: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) - IL_0029: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_002e: ldloc.0 - IL_002f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + .method public hidebysig static void ArrayLong() cil managed + { + // Code size 28 (0x1c) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.5 + IL_0006: newarr [mscorlib]System.Int64 + IL_000b: dup + IL_000c: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'$$method0x6000016-1' + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0034: ret - } // end of method TestCases::NotAnObjectInitializerWithEvent + IL_001b: ret + } // end of method TestCases::ArrayLong - .method public hidebysig static void ObjectInitializerAssignCollectionToField() cil managed + .method public hidebysig static void ArrayULong() cil managed { - // Code size 52 (0x34) - .maxstack 4 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0, - class [mscorlib]System.Collections.Generic.List`1 V_1) + // Code size 29 (0x1d) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: ldloc.0 - IL_0013: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0018: stloc.1 - IL_0019: ldloc.1 - IL_001a: ldc.i4.0 - IL_001b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0020: ldloc.1 - IL_0021: ldc.i4.1 - IL_0022: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0027: ldloc.1 - IL_0028: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_002d: ldloc.0 - IL_002e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.s 10 + IL_0007: newarr [mscorlib]System.UInt64 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=80' ''::'$$method0x6000017-1' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0033: ret - } // end of method TestCases::ObjectInitializerAssignCollectionToField + IL_001c: ret + } // end of method TestCases::ArrayULong - .method public hidebysig static void ObjectInitializerAddToCollectionInField() cil managed + .method public hidebysig static void ArrayFloat() cil managed { - // Code size 49 (0x31) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + // Code size 28 (0x1c) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: ldloc.0 - IL_0013: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0018: ldc.i4.0 - IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001e: ldloc.0 - IL_001f: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0024: ldc.i4.1 - IL_0025: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002a: ldloc.0 - IL_002b: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.6 + IL_0006: newarr [mscorlib]System.Single + IL_000b: dup + IL_000c: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=24' ''::'$$method0x6000018-1' + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0030: ret - } // end of method TestCases::ObjectInitializerAddToCollectionInField + IL_001b: ret + } // end of method TestCases::ArrayFloat - .method public hidebysig static void ObjectInitializerAssignCollectionToProperty() cil managed + .method public hidebysig static void ArrayDouble() cil managed { - // Code size 52 (0x34) - .maxstack 4 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0, - class [mscorlib]System.Collections.Generic.List`1 V_1) + // Code size 28 (0x1c) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: ldloc.0 - IL_0013: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0018: stloc.1 - IL_0019: ldloc.1 - IL_001a: ldc.i4.0 - IL_001b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0020: ldloc.1 - IL_0021: ldc.i4.1 - IL_0022: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0027: ldloc.1 - IL_0028: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_PropertyList(class [mscorlib]System.Collections.Generic.List`1) - IL_002d: ldloc.0 - IL_002e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.6 + IL_0006: newarr [mscorlib]System.Double + IL_000b: dup + IL_000c: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=48' ''::'$$method0x6000019-1' + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0033: ret - } // end of method TestCases::ObjectInitializerAssignCollectionToProperty + IL_001b: ret + } // end of method TestCases::ArrayDouble - .method public hidebysig static void ObjectInitializerAddToCollectionInProperty() cil managed + .method public hidebysig static void ArrayDecimal() cil managed { - // Code size 49 (0x31) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + // Code size 127 (0x7f) + .maxstack 7 + .locals init (valuetype [mscorlib]System.Decimal[] V_0) IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: ldloc.0 - IL_0013: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() - IL_0018: ldc.i4.0 - IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001e: ldloc.0 - IL_001f: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() - IL_0024: ldc.i4.1 - IL_0025: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002a: ldloc.0 - IL_002b: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.6 + IL_0006: newarr [mscorlib]System.Decimal + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.0 + IL_000e: ldelema [mscorlib]System.Decimal + IL_0013: ldc.i4.s -100 + IL_0015: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_001a: stobj [mscorlib]System.Decimal + IL_001f: ldloc.0 + IL_0020: ldc.i4.2 + IL_0021: ldelema [mscorlib]System.Decimal + IL_0026: ldc.i4.s 100 + IL_0028: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_002d: stobj [mscorlib]System.Decimal + IL_0032: ldloc.0 + IL_0033: ldc.i4.3 + IL_0034: ldelema [mscorlib]System.Decimal + IL_0039: ldc.i4.m1 + IL_003a: ldc.i4.m1 + IL_003b: ldc.i4.m1 + IL_003c: ldc.i4 0x80 + IL_0041: ldc.i4.0 + IL_0042: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_0047: stobj [mscorlib]System.Decimal + IL_004c: ldloc.0 + IL_004d: ldc.i4.4 + IL_004e: ldelema [mscorlib]System.Decimal + IL_0053: ldc.i4.m1 + IL_0054: ldc.i4.m1 + IL_0055: ldc.i4.m1 + IL_0056: ldc.i4.0 + IL_0057: ldc.i4.0 + IL_0058: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_005d: stobj [mscorlib]System.Decimal + IL_0062: ldloc.0 + IL_0063: ldc.i4.5 + IL_0064: ldelema [mscorlib]System.Decimal + IL_0069: ldc.i4.1 + IL_006a: ldc.i4.0 + IL_006b: ldc.i4.0 + IL_006c: ldc.i4.0 + IL_006d: ldc.i4.7 + IL_006e: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_0073: stobj [mscorlib]System.Decimal + IL_0078: ldloc.0 + IL_0079: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0030: ret - } // end of method TestCases::ObjectInitializerAddToCollectionInProperty + IL_007e: ret + } // end of method TestCases::ArrayDecimal - .method public hidebysig static void ObjectInitializerWithInitializationOfNestedObjects() cil managed + .method public hidebysig static void ArrayString() cil managed { - // Code size 47 (0x2f) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + // Code size 43 (0x2b) + .maxstack 4 + .locals init (string[] V_0) IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0011: ldc.i4.0 - IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0017: ldloc.0 - IL_0018: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_001d: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0022: ldc.i4.1 - IL_0023: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0028: ldloc.0 - IL_0029: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.4 + IL_0006: newarr [mscorlib]System.String + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.0 + IL_000e: ldstr "" + IL_0013: stelem.ref + IL_0014: ldloc.0 + IL_0015: ldc.i4.2 + IL_0016: ldstr "Hello" + IL_001b: stelem.ref + IL_001c: ldloc.0 + IL_001d: ldc.i4.3 + IL_001e: ldstr "World" + IL_0023: stelem.ref + IL_0024: ldloc.0 + IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002e: ret - } // end of method TestCases::ObjectInitializerWithInitializationOfNestedObjects + IL_002a: ret + } // end of method TestCases::ArrayString - .method private hidebysig static int32 - GetInt() cil managed + .method public hidebysig static void ArrayEnum() cil managed { - // Code size 2 (0x2) - .maxstack 8 - IL_0000: ldc.i4.1 - IL_0001: ret - } // end of method TestCases::GetInt + // Code size 27 (0x1b) + .maxstack 4 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum[] V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.4 + IL_0006: newarr ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.1 + IL_000e: ldc.i4.1 + IL_000f: stelem.i4 + IL_0010: ldloc.0 + IL_0011: ldc.i4.3 + IL_0012: ldc.i4.1 + IL_0013: stelem.i4 + IL_0014: ldloc.0 + IL_0015: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001a: ret + } // end of method TestCases::ArrayEnum - .method private hidebysig static string - GetString() cil managed + .method public hidebysig static void RecursiveArrayInitializer() cil managed { - // Code size 6 (0x6) - .maxstack 8 - IL_0000: ldstr "Test" - IL_0005: ret - } // end of method TestCases::GetString + // Code size 28 (0x1c) + .maxstack 4 + .locals init (int32[] V_0) + IL_0000: ldc.i4.3 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.0 + IL_0009: ldc.i4.1 + IL_000a: stelem.i4 + IL_000b: ldloc.0 + IL_000c: ldc.i4.1 + IL_000d: ldc.i4.2 + IL_000e: stelem.i4 + IL_000f: ldloc.0 + IL_0010: ldc.i4.2 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: ldelem.i4 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: stelem.i4 + IL_0017: ldloc.0 + IL_0018: ldc.i4.0 + IL_0019: ldc.i4.0 + IL_001a: stelem.i4 + IL_001b: ret + } // end of method TestCases::RecursiveArrayInitializer - .method private hidebysig static void NoOp(valuetype [mscorlib]System.Nullable`1[] 'array') cil managed + .method public hidebysig static void InvalidIndices(int32 a) cil managed { - // Code size 1 (0x1) - .maxstack 8 - IL_0000: ret - } // end of method TestCases::NoOp + // Code size 23 (0x17) + .maxstack 3 + .locals init (int32[] V_0) + IL_0000: ldc.i4.1 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.1 + IL_0009: ldarg.0 + IL_000a: stelem.i4 + IL_000b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0010: ldloc.0 + IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0016: ret + } // end of method TestCases::InvalidIndices - .method public hidebysig static void ObjectInitializerWithInitializationOfDeeplyNestedObjects() cil managed + .method public hidebysig static void InvalidIndices2(int32 a) cil managed { - // Code size 79 (0x4f) + // Code size 23 (0x17) .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) - IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: stloc.0 + .locals init (int32[] V_0) + IL_0000: ldc.i4.1 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.m1 + IL_0009: ldarg.0 + IL_000a: stelem.i4 + IL_000b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0010: ldloc.0 + IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0016: ret + } // end of method TestCases::InvalidIndices2 + + .method public hidebysig static void IndicesInWrongOrder(int32 a, + int32 b) cil managed + { + // Code size 27 (0x1b) + .maxstack 3 + .locals init (int32[] V_0) + IL_0000: ldc.i4.5 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.2 + IL_0009: ldarg.1 + IL_000a: stelem.i4 IL_000b: ldloc.0 IL_000c: ldc.i4.1 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: ldloc.0 - IL_0013: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0018: ldc.i4.0 - IL_0019: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_001e: ldloc.0 - IL_001f: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0024: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0029: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_002e: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0033: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0038: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_003d: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0042: ldc.i4.1 - IL_0043: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0048: ldloc.0 - IL_0049: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_000d: ldarg.0 + IL_000e: stelem.i4 + IL_000f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0014: ldloc.0 + IL_0015: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_004e: ret - } // end of method TestCases::ObjectInitializerWithInitializationOfDeeplyNestedObjects + IL_001a: ret + } // end of method TestCases::IndicesInWrongOrder - .method public hidebysig static void CollectionInitializerInsideObjectInitializers() cil managed + .method public hidebysig static void Issue953_MissingNullableSpecifierForArrayInitializer() cil managed { - // Code size 57 (0x39) + // Code size 36 (0x24) + .maxstack 2 + .locals init (valuetype [mscorlib]System.Nullable`1[] V_0) + IL_0000: ldc.i4.1 + IL_0001: newarr valuetype [mscorlib]System.Nullable`1 + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.0 + IL_0009: ldelema valuetype [mscorlib]System.Nullable`1 + IL_000e: ldsfld valuetype [mscorlib]System.Guid [mscorlib]System.Guid::Empty + IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0018: stobj valuetype [mscorlib]System.Nullable`1 + IL_001d: ldloc.0 + IL_001e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::NoOp(valuetype [mscorlib]System.Nullable`1[]) + IL_0023: ret + } // end of method TestCases::Issue953_MissingNullableSpecifierForArrayInitializer + + .method private hidebysig instance void + Issue907_Test3(string text) cil managed + { + // Code size 30 (0x1e) .maxstack 4 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_1) + .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() IL_000a: stloc.0 IL_000b: ldloc.0 - IL_000c: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0011: stloc.1 - IL_0012: ldloc.1 - IL_0013: ldc.i4.0 - IL_0014: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0019: ldloc.1 - IL_001a: ldc.i4.1 - IL_001b: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_b(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0020: ldloc.1 - IL_0021: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() - IL_0026: ldc.i4.0 - IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002c: ldloc.1 - IL_002d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_MoreData(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) - IL_0032: ldloc.0 - IL_0033: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_000c: ldstr "" + IL_0011: ldarg.1 + IL_0012: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0017: ldloc.0 + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0038: ret - } // end of method TestCases::CollectionInitializerInsideObjectInitializers + IL_001d: ret + } // end of method TestCases::Issue907_Test3 - .method public hidebysig static void NotAStructInitializer_DefaultConstructor() cil managed + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test1() cil managed { - // Code size 41 (0x29) + // Code size 36 (0x24) .maxstack 2 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) - IL_0000: ldloca.s V_0 - IL_0002: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0008: ldloca.s V_0 - IL_000a: ldc.i4.1 - IL_000b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0010: ldloca.s V_0 - IL_0012: ldc.i4.2 - IL_0013: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_0018: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_001d: ldloc.0 - IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0028: ret - } // end of method TestCases::NotAStructInitializer_DefaultConstructor + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000c: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_0011: ldloc.0 + IL_0012: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_0017: ldc.i4.1 + IL_0018: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_001d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0022: ldloc.0 + IL_0023: ret + } // end of method TestCases::Test1 - .method public hidebysig static void StructInitializer_DefaultConstructor() cil managed + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test1Alternative() cil managed { - // Code size 41 (0x29) - .maxstack 3 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) - IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: ldloca.s V_0 - IL_0007: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_000d: ldloca.s V_0 + // Code size 39 (0x27) + .maxstack 4 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class [mscorlib]System.Collections.Generic.List`1 V_1) + IL_0000: ldc.i4.1 + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000d: stloc.1 + IL_000e: ldloc.1 IL_000f: ldc.i4.1 - IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0015: ldloca.s V_0 - IL_0017: ldc.i4.2 - IL_0018: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_001d: ldloc.0 - IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0028: ret - } // end of method TestCases::StructInitializer_DefaultConstructor + IL_0010: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_0015: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001a: ldloc.1 + IL_001b: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_0020: ldloc.0 + IL_0021: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) + IL_0026: ret + } // end of method TestCases::Test1Alternative - .method public hidebysig static void NotAStructInitializer_ExplicitConstructor() cil managed + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test2() cil managed { - // Code size 41 (0x29) + // Code size 22 (0x16) .maxstack 2 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) - IL_0000: ldloca.s V_0 - IL_0002: ldc.i4.0 - IL_0003: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) - IL_0008: ldloca.s V_0 - IL_000a: ldc.i4.1 - IL_000b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0010: ldloca.s V_0 - IL_0012: ldc.i4.2 - IL_0013: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_0018: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_001d: ldloc.0 - IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0028: ret - } // end of method TestCases::NotAStructInitializer_ExplicitConstructor + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.1 + IL_0008: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_000d: ldloc.0 + IL_000e: ldc.i4.2 + IL_000f: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_0014: ldloc.0 + IL_0015: ret + } // end of method TestCases::Test2 - .method public hidebysig static void StructInitializer_ExplicitConstructor() cil managed + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test3() cil managed { - // Code size 41 (0x29) - .maxstack 3 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) - IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: ldloca.s V_0 - IL_0007: ldc.i4.0 - IL_0008: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) - IL_000d: ldloca.s V_0 - IL_000f: ldc.i4.1 - IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0015: ldloca.s V_0 - IL_0017: ldc.i4.2 - IL_0018: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_001d: ldloc.0 - IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0028: ret - } // end of method TestCases::StructInitializer_ExplicitConstructor + // Code size 32 (0x20) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.1 + IL_0008: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_000d: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0012: ldloc.0 + IL_0013: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0018: ldc.i4.2 + IL_0019: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_001e: ldloc.0 + IL_001f: ret + } // end of method TestCases::Test3 - .method public hidebysig static void StructInitializerWithInitializationOfNestedObjects() cil managed + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test3b() cil managed { - // Code size 74 (0x4a) + // Code size 33 (0x21) .maxstack 3 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) - IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: ldloca.s V_0 - IL_0007: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_000d: ldloca.s V_0 - IL_000f: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() - IL_0014: ldc.i4.0 - IL_0015: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_001a: ldloca.s V_0 - IL_001c: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() - IL_0021: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0026: ldc.i4.0 - IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002c: ldloca.s V_0 - IL_002e: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() - IL_0033: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0038: ldc.i4.1 - IL_0039: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_003e: ldloc.0 - IL_003f: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0044: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0049: ret - } // end of method TestCases::StructInitializerWithInitializationOfNestedObjects + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + IL_0000: ldc.i4.0 + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.1 + IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_000e: ldloc.0 + IL_000f: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0014: ldc.i4.2 + IL_0015: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_001a: ldloc.0 + IL_001b: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) + IL_0020: ret + } // end of method TestCases::Test3b - .method public hidebysig static void StructInitializerWithinObjectInitializer() cil managed + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test4() cil managed { - // Code size 49 (0x31) - .maxstack 4 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0, - valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_1) + // Code size 39 (0x27) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_000c: ldc.i4.1 + IL_000d: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_0012: ldloc.0 + IL_0013: ldc.i4.2 + IL_0014: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_0019: ldloc.0 + IL_001a: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_001f: ldc.i4.3 + IL_0020: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::B + IL_0025: ldloc.0 + IL_0026: ret + } // end of method TestCases::Test4 + + .method public hidebysig static void ObjectInitializer() cil managed + { + // Code size 25 (0x19) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() IL_000a: stloc.0 IL_000b: ldloc.0 - IL_000c: ldloca.s V_1 - IL_000e: ldc.i4.2 - IL_000f: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) - IL_0014: ldloca.s V_1 - IL_0016: ldc.i4.1 - IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_001c: ldloca.s V_1 - IL_001e: ldc.i4.2 - IL_001f: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_0024: ldloc.1 - IL_0025: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_NestedStruct(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData) - IL_002a: ldloc.0 - IL_002b: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: ldloc.0 + IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0030: ret - } // end of method TestCases::StructInitializerWithinObjectInitializer + IL_0018: ret + } // end of method TestCases::ObjectInitializer - .method public hidebysig static void Bug270_NestedInitialisers() cil managed + .method public hidebysig static void NotAnObjectInitializer() cil managed { - // Code size 119 (0x77) - .maxstack 6 - .locals init (class [mscorlib]System.Globalization.NumberFormatInfo[] V_0, - class [mscorlib]System.Threading.Thread V_1, - class [mscorlib]System.Globalization.CultureInfo V_2, - class [mscorlib]System.Globalization.DateTimeFormatInfo V_3) - IL_0000: ldnull - IL_0001: stloc.0 - IL_0002: ldc.i4.0 - IL_0003: ldnull - IL_0004: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Bug270_NestedInitialisers() - IL_000a: newobj instance void [mscorlib]System.Threading.ThreadStart::.ctor(object, - native int) - IL_000f: newobj instance void [mscorlib]System.Threading.Thread::.ctor(class [mscorlib]System.Threading.ThreadStart) + // Code size 25 (0x19) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.0 + IL_0008: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_000d: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0012: ldloc.0 + IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0018: ret + } // end of method TestCases::NotAnObjectInitializer + + .method public hidebysig static void NotAnObjectInitializerWithEvent() cil managed + { + // Code size 53 (0x35) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate6' + IL_000c: brtrue.s IL_001f + + IL_000e: ldnull + IL_000f: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'b__5'(object, + class [mscorlib]System.EventArgs) + IL_0015: newobj instance void [mscorlib]System.EventHandler::.ctor(object, + native int) + IL_001a: stsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate6' + IL_001f: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate6' + IL_0024: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) + IL_0029: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_002e: ldloc.0 + IL_002f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0034: ret + } // end of method TestCases::NotAnObjectInitializerWithEvent + + .method public hidebysig static void ObjectInitializerAssignCollectionToField() cil managed + { + // Code size 52 (0x34) + .maxstack 4 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0, + class [mscorlib]System.Collections.Generic.List`1 V_1) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: ldloc.0 + IL_0013: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: ldc.i4.0 + IL_001b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0027: ldloc.1 + IL_0028: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_002d: ldloc.0 + IL_002e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0033: ret + } // end of method TestCases::ObjectInitializerAssignCollectionToField + + .method public hidebysig static void ObjectInitializerAddToCollectionInField() cil managed + { + // Code size 49 (0x31) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: ldloc.0 + IL_0013: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0018: ldc.i4.0 + IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001e: ldloc.0 + IL_001f: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0024: ldc.i4.1 + IL_0025: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002a: ldloc.0 + IL_002b: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0030: ret + } // end of method TestCases::ObjectInitializerAddToCollectionInField + + .method public hidebysig static void ObjectInitializerAssignCollectionToProperty() cil managed + { + // Code size 52 (0x34) + .maxstack 4 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0, + class [mscorlib]System.Collections.Generic.List`1 V_1) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: ldloc.0 + IL_0013: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: ldc.i4.0 + IL_001b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0027: ldloc.1 + IL_0028: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_PropertyList(class [mscorlib]System.Collections.Generic.List`1) + IL_002d: ldloc.0 + IL_002e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0033: ret + } // end of method TestCases::ObjectInitializerAssignCollectionToProperty + + .method public hidebysig static void ObjectInitializerAddToCollectionInProperty() cil managed + { + // Code size 49 (0x31) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: ldloc.0 + IL_0013: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() + IL_0018: ldc.i4.0 + IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001e: ldloc.0 + IL_001f: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() + IL_0024: ldc.i4.1 + IL_0025: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002a: ldloc.0 + IL_002b: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0030: ret + } // end of method TestCases::ObjectInitializerAddToCollectionInProperty + + .method public hidebysig static void ObjectInitializerWithInitializationOfNestedObjects() cil managed + { + // Code size 47 (0x2f) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0011: ldc.i4.0 + IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0017: ldloc.0 + IL_0018: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_001d: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0022: ldc.i4.1 + IL_0023: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0028: ldloc.0 + IL_0029: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002e: ret + } // end of method TestCases::ObjectInitializerWithInitializationOfNestedObjects + + .method public hidebysig static void ObjectInitializerWithInitializationOfDeeplyNestedObjects() cil managed + { + // Code size 79 (0x4f) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldc.i4.1 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: ldloc.0 + IL_0013: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0018: ldc.i4.0 + IL_0019: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_001e: ldloc.0 + IL_001f: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0024: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0029: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_002e: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0033: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0038: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_003d: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0042: ldc.i4.1 + IL_0043: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0048: ldloc.0 + IL_0049: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_004e: ret + } // end of method TestCases::ObjectInitializerWithInitializationOfDeeplyNestedObjects + + .method public hidebysig static void CollectionInitializerInsideObjectInitializers() cil managed + { + // Code size 57 (0x39) + .maxstack 4 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_1) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldc.i4.0 + IL_0014: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0019: ldloc.1 + IL_001a: ldc.i4.1 + IL_001b: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_b(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0020: ldloc.1 + IL_0021: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() + IL_0026: ldc.i4.0 + IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002c: ldloc.1 + IL_002d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_MoreData(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) + IL_0032: ldloc.0 + IL_0033: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0038: ret + } // end of method TestCases::CollectionInitializerInsideObjectInitializers + + .method public hidebysig static void NotAStructInitializer_DefaultConstructor() cil managed + { + // Code size 41 (0x29) + .maxstack 2 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: ldloca.s V_0 + IL_0002: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0008: ldloca.s V_0 + IL_000a: ldc.i4.1 + IL_000b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0010: ldloca.s V_0 + IL_0012: ldc.i4.2 + IL_0013: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_0018: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_001d: ldloc.0 + IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0028: ret + } // end of method TestCases::NotAStructInitializer_DefaultConstructor + + .method public hidebysig static void StructInitializer_DefaultConstructor() cil managed + { + // Code size 41 (0x29) + .maxstack 3 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldloca.s V_0 + IL_0007: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_000d: ldloca.s V_0 + IL_000f: ldc.i4.1 + IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0015: ldloca.s V_0 + IL_0017: ldc.i4.2 + IL_0018: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_001d: ldloc.0 + IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0028: ret + } // end of method TestCases::StructInitializer_DefaultConstructor + + .method public hidebysig static void NotAStructInitializer_ExplicitConstructor() cil managed + { + // Code size 41 (0x29) + .maxstack 2 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: ldloca.s V_0 + IL_0002: ldc.i4.0 + IL_0003: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) + IL_0008: ldloca.s V_0 + IL_000a: ldc.i4.1 + IL_000b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0010: ldloca.s V_0 + IL_0012: ldc.i4.2 + IL_0013: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_0018: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_001d: ldloc.0 + IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0028: ret + } // end of method TestCases::NotAStructInitializer_ExplicitConstructor + + .method public hidebysig static void StructInitializer_ExplicitConstructor() cil managed + { + // Code size 41 (0x29) + .maxstack 3 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldloca.s V_0 + IL_0007: ldc.i4.0 + IL_0008: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) + IL_000d: ldloca.s V_0 + IL_000f: ldc.i4.1 + IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0015: ldloca.s V_0 + IL_0017: ldc.i4.2 + IL_0018: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_001d: ldloc.0 + IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0028: ret + } // end of method TestCases::StructInitializer_ExplicitConstructor + + .method public hidebysig static void StructInitializerWithInitializationOfNestedObjects() cil managed + { + // Code size 74 (0x4a) + .maxstack 3 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldloca.s V_0 + IL_0007: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_000d: ldloca.s V_0 + IL_000f: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() + IL_0014: ldc.i4.0 + IL_0015: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_001a: ldloca.s V_0 + IL_001c: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() + IL_0021: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0026: ldc.i4.0 + IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002c: ldloca.s V_0 + IL_002e: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() + IL_0033: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0038: ldc.i4.1 + IL_0039: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_003e: ldloc.0 + IL_003f: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0044: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0049: ret + } // end of method TestCases::StructInitializerWithInitializationOfNestedObjects + + .method public hidebysig static void StructInitializerWithinObjectInitializer() cil managed + { + // Code size 49 (0x31) + .maxstack 4 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0, + valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_1) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldloca.s V_1 + IL_000e: ldc.i4.2 + IL_000f: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) + IL_0014: ldloca.s V_1 + IL_0016: ldc.i4.1 + IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_001c: ldloca.s V_1 + IL_001e: ldc.i4.2 + IL_001f: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_0024: ldloc.1 + IL_0025: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_NestedStruct(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData) + IL_002a: ldloc.0 + IL_002b: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0030: ret + } // end of method TestCases::StructInitializerWithinObjectInitializer + + .method public hidebysig static void Issue270_NestedInitialisers() cil managed + { + // Code size 119 (0x77) + .maxstack 6 + .locals init (class [mscorlib]System.Globalization.NumberFormatInfo[] V_0, + class [mscorlib]System.Threading.Thread V_1, + class [mscorlib]System.Globalization.CultureInfo V_2, + class [mscorlib]System.Globalization.DateTimeFormatInfo V_3) + IL_0000: ldnull + IL_0001: stloc.0 + IL_0002: ldc.i4.0 + IL_0003: ldnull + IL_0004: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Issue270_NestedInitialisers() + IL_000a: newobj instance void [mscorlib]System.Threading.ThreadStart::.ctor(object, + native int) + IL_000f: newobj instance void [mscorlib]System.Threading.Thread::.ctor(class [mscorlib]System.Threading.ThreadStart) IL_0014: stloc.1 IL_0015: ldloc.1 IL_0016: ldc.i4.1 - IL_0017: callvirt instance void [mscorlib]System.Threading.Thread::set_Priority(valuetype [mscorlib]System.Threading.ThreadPriority) + IL_0017: callvirt instance void [mscorlib]System.Threading.Thread::set_Priority(valuetype [mscorlib]System.Threading.ThreadPriority) + IL_001c: ldloc.1 + IL_001d: ldc.i4.0 + IL_001e: newobj instance void [mscorlib]System.Globalization.CultureInfo::.ctor(int32) + IL_0023: stloc.2 + IL_0024: ldloc.2 + IL_0025: newobj instance void [mscorlib]System.Globalization.DateTimeFormatInfo::.ctor() + IL_002a: stloc.3 + IL_002b: ldloc.3 + IL_002c: ldstr "ddmmyy" + IL_0031: callvirt instance void [mscorlib]System.Globalization.DateTimeFormatInfo::set_ShortDatePattern(string) + IL_0036: ldloc.3 + IL_0037: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_DateTimeFormat(class [mscorlib]System.Globalization.DateTimeFormatInfo) + IL_003c: ldloc.2 + IL_003d: ldloc.0 + IL_003e: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1a' + IL_0043: brtrue.s IL_0056 + + IL_0045: ldnull + IL_0046: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'b__19'(class [mscorlib]System.Globalization.NumberFormatInfo) + IL_004c: newobj instance void class [mscorlib]System.Func`2::.ctor(object, + native int) + IL_0051: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1a' + IL_0056: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1a' + IL_005b: call class [mscorlib]System.Collections.Generic.IEnumerable`1 [System.Core]System.Linq.Enumerable::Where(class [mscorlib]System.Collections.Generic.IEnumerable`1, + class [mscorlib]System.Func`2) + IL_0060: call !!0 [System.Core]System.Linq.Enumerable::First(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0065: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_NumberFormat(class [mscorlib]System.Globalization.NumberFormatInfo) + IL_006a: ldloc.2 + IL_006b: callvirt instance void [mscorlib]System.Threading.Thread::set_CurrentCulture(class [mscorlib]System.Globalization.CultureInfo) + IL_0070: ldloc.1 + IL_0071: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class [mscorlib]System.Threading.Thread) + IL_0076: ret + } // end of method TestCases::Issue270_NestedInitialisers + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 + Issue1345() cil managed + { + // Code size 30 (0x1e) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0) + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::Data + IL_000c: ldc.i4.3 + IL_000d: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0012: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0017: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_001c: ldloc.0 + IL_001d: ret + } // end of method TestCases::Issue1345 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 + Issue1345b() cil managed + { + // Code size 30 (0x1e) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0) + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data2() + IL_000c: ldc.i4.3 + IL_000d: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0012: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0017: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_001c: ldloc.0 + IL_001d: ret + } // end of method TestCases::Issue1345b + + .method private hidebysig instance void + Issue1250_Test1(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum 'value') cil managed + { + // Code size 25 (0x19) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldarg.1 + IL_000d: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_0012: ldloc.0 + IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0018: ret + } // end of method TestCases::Issue1250_Test1 + + .method private hidebysig instance void + Issue1251_Test(class [mscorlib]System.Collections.Generic.List`1 list, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem otherItem) cil managed + { + // Code size 154 (0x9a) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item V_0, + valuetype [mscorlib]System.Nullable`1 V_1, + valuetype [mscorlib]System.Nullable`1 V_2, + valuetype [mscorlib]System.Nullable`1 V_3, + valuetype [mscorlib]System.Nullable`1 V_4) + IL_0000: ldarg.1 + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldstr "Text" + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Text(string) + IL_0012: ldloc.0 + IL_0013: ldarg.2 + IL_0014: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value() + IL_0019: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value(valuetype [mscorlib]System.Decimal) + IL_001e: ldloc.0 + IL_001f: ldarg.2 + IL_0020: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value2() + IL_0025: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value2(valuetype [mscorlib]System.Decimal) + IL_002a: ldloc.0 + IL_002b: ldarg.2 + IL_002c: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable() + IL_0031: stloc.1 + IL_0032: ldloca.s V_1 + IL_0034: constrained. valuetype [mscorlib]System.Nullable`1 + IL_003a: callvirt instance string [mscorlib]System.Object::ToString() + IL_003f: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value3(string) + IL_0044: ldloc.0 + IL_0045: ldarg.2 + IL_0046: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable2() + IL_004b: stloc.2 + IL_004c: ldloca.s V_2 + IL_004e: constrained. valuetype [mscorlib]System.Nullable`1 + IL_0054: callvirt instance string [mscorlib]System.Object::ToString() + IL_0059: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value4(string) + IL_005e: ldloc.0 + IL_005f: ldarg.2 + IL_0060: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable3() + IL_0065: stloc.3 + IL_0066: ldloca.s V_3 + IL_0068: constrained. valuetype [mscorlib]System.Nullable`1 + IL_006e: callvirt instance string [mscorlib]System.Object::ToString() + IL_0073: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value5(string) + IL_0078: ldloc.0 + IL_0079: ldarg.2 + IL_007a: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable4() + IL_007f: stloc.s V_4 + IL_0081: ldloca.s V_4 + IL_0083: constrained. valuetype [mscorlib]System.Nullable`1 + IL_0089: callvirt instance string [mscorlib]System.Object::ToString() + IL_008e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value6(string) + IL_0093: ldloc.0 + IL_0094: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0099: ret + } // end of method TestCases::Issue1251_Test + + .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data + Issue1279(int32 p) cil managed + { + // Code size 39 (0x27) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: ldarg.1 + IL_0001: ldc.i4.1 + IL_0002: bne.un.s IL_0025 + + IL_0004: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: ldc.i4.0 + IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0011: ldloc.0 + IL_0012: ldarg.0 + IL_0013: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Data_TestEvent(object, + class [mscorlib]System.EventArgs) + IL_0019: newobj instance void [mscorlib]System.EventHandler::.ctor(object, + native int) + IL_001e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) + IL_0023: ldloc.0 + IL_0024: ret + + IL_0025: ldnull + IL_0026: ret + } // end of method TestCases::Issue1279 + + .method public hidebysig static void ExtensionMethodInCollectionInitializer() cil managed + { + // Code size 40 (0x28) + .maxstack 4 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0, + int32[] V_1) + IL_0000: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.2 + IL_0008: newarr [mscorlib]System.Int32 + IL_000d: stloc.1 + IL_000e: ldloc.1 + IL_000f: ldc.i4.0 + IL_0010: ldc.i4.1 + IL_0011: stelem.i4 + IL_0012: ldloc.1 + IL_0013: ldc.i4.1 + IL_0014: ldc.i4.2 + IL_0015: stelem.i4 + IL_0016: ldloc.1 + IL_0017: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) + IL_001c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0021: ldloc.0 + IL_0022: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0027: ret + } // end of method TestCases::ExtensionMethodInCollectionInitializer + + .method public hidebysig static void NoCollectionInitializerBecauseOfTypeArguments() cil managed + { + // Code size 24 (0x18) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) + IL_0000: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldstr "int" + IL_000c: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(string) + IL_0011: ldloc.0 + IL_0012: call void [mscorlib]System.Console::WriteLine(object) + IL_0017: ret + } // end of method TestCases::NoCollectionInitializerBecauseOfTypeArguments + + .method public hidebysig static void CollectionInitializerWithParamsMethod() cil managed + { + // Code size 76 (0x4c) + .maxstack 5 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0, + int32[] V_1) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldc.i4.s 10 + IL_000e: newarr [mscorlib]System.Int32 + IL_0013: stloc.1 + IL_0014: ldloc.1 + IL_0015: ldc.i4.0 + IL_0016: ldc.i4.1 + IL_0017: stelem.i4 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: ldc.i4.2 + IL_001b: stelem.i4 IL_001c: ldloc.1 - IL_001d: ldc.i4.0 - IL_001e: newobj instance void [mscorlib]System.Globalization.CultureInfo::.ctor(int32) - IL_0023: stloc.2 - IL_0024: ldloc.2 - IL_0025: newobj instance void [mscorlib]System.Globalization.DateTimeFormatInfo::.ctor() - IL_002a: stloc.3 - IL_002b: ldloc.3 - IL_002c: ldstr "ddmmyy" - IL_0031: callvirt instance void [mscorlib]System.Globalization.DateTimeFormatInfo::set_ShortDatePattern(string) - IL_0036: ldloc.3 - IL_0037: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_DateTimeFormat(class [mscorlib]System.Globalization.DateTimeFormatInfo) - IL_003c: ldloc.2 - IL_003d: ldloc.0 - IL_003e: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1d' - IL_0043: brtrue.s IL_0056 + IL_001d: ldc.i4.2 + IL_001e: ldc.i4.3 + IL_001f: stelem.i4 + IL_0020: ldloc.1 + IL_0021: ldc.i4.3 + IL_0022: ldc.i4.4 + IL_0023: stelem.i4 + IL_0024: ldloc.1 + IL_0025: ldc.i4.4 + IL_0026: ldc.i4.5 + IL_0027: stelem.i4 + IL_0028: ldloc.1 + IL_0029: ldc.i4.5 + IL_002a: ldc.i4.6 + IL_002b: stelem.i4 + IL_002c: ldloc.1 + IL_002d: ldc.i4.6 + IL_002e: ldc.i4.7 + IL_002f: stelem.i4 + IL_0030: ldloc.1 + IL_0031: ldc.i4.7 + IL_0032: ldc.i4.8 + IL_0033: stelem.i4 + IL_0034: ldloc.1 + IL_0035: ldc.i4.8 + IL_0036: ldc.i4.s 9 + IL_0038: stelem.i4 + IL_0039: ldloc.1 + IL_003a: ldc.i4.s 9 + IL_003c: ldc.i4.s 10 + IL_003e: stelem.i4 + IL_003f: ldloc.1 + IL_0040: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) + IL_0045: ldloc.0 + IL_0046: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_004b: ret + } // end of method TestCases::CollectionInitializerWithParamsMethod - IL_0045: ldnull - IL_0046: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'b__1c'(class [mscorlib]System.Globalization.NumberFormatInfo) - IL_004c: newobj instance void class [mscorlib]System.Func`2::.ctor(object, - native int) - IL_0051: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1d' - IL_0056: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::'CS$<>9__CachedAnonymousMethodDelegate1d' - IL_005b: call class [mscorlib]System.Collections.Generic.IEnumerable`1 [System.Core]System.Linq.Enumerable::Where(class [mscorlib]System.Collections.Generic.IEnumerable`1, - class [mscorlib]System.Func`2) - IL_0060: call !!0 [System.Core]System.Linq.Enumerable::First(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0065: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_NumberFormat(class [mscorlib]System.Globalization.NumberFormatInfo) - IL_006a: ldloc.2 - IL_006b: callvirt instance void [mscorlib]System.Threading.Thread::set_CurrentCulture(class [mscorlib]System.Globalization.CultureInfo) - IL_0070: ldloc.1 - IL_0071: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class [mscorlib]System.Threading.Thread) - IL_0076: ret - } // end of method TestCases::Bug270_NestedInitialisers + .method public hidebysig static void CollectionInitializerList() cil managed + { + // Code size 39 (0x27) + .maxstack 3 + .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldc.i4.1 + IL_000d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0012: ldloc.0 + IL_0013: ldc.i4.2 + IL_0014: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0019: ldloc.0 + IL_001a: ldc.i4.3 + IL_001b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0020: ldloc.0 + IL_0021: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0026: ret + } // end of method TestCases::CollectionInitializerList - .method public hidebysig static void Bug953_MissingNullableSpecifierForArrayInitializer() cil managed + .method public hidebysig static object + RecursiveCollectionInitializer() cil managed { - // Code size 36 (0x24) + // Code size 15 (0xf) .maxstack 2 - .locals init (valuetype [mscorlib]System.Nullable`1[] V_0) - IL_0000: ldc.i4.1 - IL_0001: newarr valuetype [mscorlib]System.Nullable`1 - IL_0006: stloc.0 + .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) + IL_0000: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 IL_0007: ldloc.0 - IL_0008: ldc.i4.0 - IL_0009: ldelema valuetype [mscorlib]System.Nullable`1 - IL_000e: ldsfld valuetype [mscorlib]System.Guid [mscorlib]System.Guid::Empty - IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0018: stobj valuetype [mscorlib]System.Nullable`1 - IL_001d: ldloc.0 - IL_001e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::NoOp(valuetype [mscorlib]System.Nullable`1[]) - IL_0023: ret - } // end of method TestCases::Bug953_MissingNullableSpecifierForArrayInitializer + IL_0008: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000d: ldloc.0 + IL_000e: ret + } // end of method TestCases::RecursiveCollectionInitializer - .method private hidebysig instance void - Issue907_Test3(string text) cil managed + .method public hidebysig static void CollectionInitializerDictionary() cil managed { - // Code size 30 (0x1e) + // Code size 54 (0x36) .maxstack 4 - .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) + .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() + IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() IL_000a: stloc.0 IL_000b: ldloc.0 - IL_000c: ldstr "" - IL_0011: ldarg.1 - IL_0012: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) + IL_000c: ldstr "First" + IL_0011: ldc.i4.1 + IL_0012: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) IL_0017: ldloc.0 - IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0018: ldstr "Second" + IL_001d: ldc.i4.2 + IL_001e: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0023: ldloc.0 + IL_0024: ldstr "Third" + IL_0029: ldc.i4.3 + IL_002a: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_002f: ldloc.0 + IL_0030: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_001d: ret - } // end of method TestCases::Issue907_Test3 + IL_0035: ret + } // end of method TestCases::CollectionInitializerDictionary - .method private hidebysig instance void - Issue1250_Test1(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum 'value') cil managed + .method public hidebysig static void CollectionInitializerDictionaryWithEnumTypes() cil managed { - // Code size 25 (0x19) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + // Code size 34 (0x22) + .maxstack 4 + .locals init (class [mscorlib]System.Collections.Generic.Dictionary`2 V_0) IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() IL_000a: stloc.0 IL_000b: ldloc.0 - IL_000c: ldarg.1 - IL_000d: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_0012: ldloc.0 - IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_000c: ldc.i4.0 + IL_000d: ldc.i4.0 + IL_000e: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: ldc.i4.1 + IL_0016: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_001b: ldloc.0 + IL_001c: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0018: ret - } // end of method TestCases::Issue1250_Test1 - - .method private hidebysig instance void - Issue1251_Test(class [mscorlib]System.Collections.Generic.List`1 list, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem otherItem) cil managed - { - // Code size 154 (0x9a) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item V_0, - valuetype [mscorlib]System.Nullable`1 V_1, - valuetype [mscorlib]System.Nullable`1 V_2, - valuetype [mscorlib]System.Nullable`1 V_3, - valuetype [mscorlib]System.Nullable`1 V_4) - IL_0000: ldarg.1 - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldstr "Text" - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Text(string) - IL_0012: ldloc.0 - IL_0013: ldarg.2 - IL_0014: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value() - IL_0019: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value(valuetype [mscorlib]System.Decimal) - IL_001e: ldloc.0 - IL_001f: ldarg.2 - IL_0020: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value2() - IL_0025: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value2(valuetype [mscorlib]System.Decimal) - IL_002a: ldloc.0 - IL_002b: ldarg.2 - IL_002c: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable() - IL_0031: stloc.1 - IL_0032: ldloca.s V_1 - IL_0034: constrained. valuetype [mscorlib]System.Nullable`1 - IL_003a: callvirt instance string [mscorlib]System.Object::ToString() - IL_003f: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value3(string) - IL_0044: ldloc.0 - IL_0045: ldarg.2 - IL_0046: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable2() - IL_004b: stloc.2 - IL_004c: ldloca.s V_2 - IL_004e: constrained. valuetype [mscorlib]System.Nullable`1 - IL_0054: callvirt instance string [mscorlib]System.Object::ToString() - IL_0059: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value4(string) - IL_005e: ldloc.0 - IL_005f: ldarg.2 - IL_0060: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable3() - IL_0065: stloc.3 - IL_0066: ldloca.s V_3 - IL_0068: constrained. valuetype [mscorlib]System.Nullable`1 - IL_006e: callvirt instance string [mscorlib]System.Object::ToString() - IL_0073: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value5(string) - IL_0078: ldloc.0 - IL_0079: ldarg.2 - IL_007a: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable4() - IL_007f: stloc.s V_4 - IL_0081: ldloca.s V_4 - IL_0083: constrained. valuetype [mscorlib]System.Nullable`1 - IL_0089: callvirt instance string [mscorlib]System.Object::ToString() - IL_008e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value6(string) - IL_0093: ldloc.0 - IL_0094: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0099: ret - } // end of method TestCases::Issue1251_Test + IL_0021: ret + } // end of method TestCases::CollectionInitializerDictionaryWithEnumTypes - .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data - Issue1279(int32 p) cil managed + .method public hidebysig static void NotACollectionInitializer() cil managed { // Code size 39 (0x27) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) - IL_0000: ldarg.1 - IL_0001: ldc.i4.1 - IL_0002: bne.un.s IL_0025 - - IL_0004: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0009: stloc.0 - IL_000a: ldloc.0 - IL_000b: ldc.i4.0 - IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0011: ldloc.0 - IL_0012: ldarg.0 - IL_0013: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Data_TestEvent(object, - class [mscorlib]System.EventArgs) - IL_0019: newobj instance void [mscorlib]System.EventHandler::.ctor(object, - native int) - IL_001e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) - IL_0023: ldloc.0 - IL_0024: ret - - IL_0025: ldnull - IL_0026: ret - } // end of method TestCases::Issue1279 - - .method private hidebysig instance void - Data_TestEvent(object sender, - class [mscorlib]System.EventArgs e) cil managed - { - // Code size 6 (0x6) - .maxstack 8 - IL_0000: newobj instance void [mscorlib]System.NotImplementedException::.ctor() - IL_0005: throw - } // end of method TestCases::Data_TestEvent - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 - Issue1345() cil managed - { - // Code size 30 (0x1e) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0) - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::Data - IL_000c: ldc.i4.3 - IL_000d: newobj instance void [mscorlib]System.Decimal::.ctor(int32) - IL_0012: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0017: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) - IL_001c: ldloc.0 - IL_001d: ret - } // end of method TestCases::Issue1345 - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 - Issue1345b() cil managed - { - // Code size 30 (0x1e) .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0) - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) + IL_0000: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() IL_0005: stloc.0 IL_0006: ldloc.0 - IL_0007: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data2() - IL_000c: ldc.i4.3 - IL_000d: newobj instance void [mscorlib]System.Decimal::.ctor(int32) - IL_0012: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0017: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) - IL_001c: ldloc.0 - IL_001d: ret - } // end of method TestCases::Issue1345b + IL_0007: ldc.i4.1 + IL_0008: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000d: ldloc.0 + IL_000e: ldc.i4.2 + IL_000f: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0014: ldloc.0 + IL_0015: ldc.i4.3 + IL_0016: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0020: ldloc.0 + IL_0021: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0026: ret + } // end of method TestCases::NotACollectionInitializer .method public hidebysig specialname rtspecialname instance void .ctor() cil managed @@ -2235,7 +2906,7 @@ IL_0006: ret } // end of method TestCases::.ctor - .method private hidebysig static void 'b__8'(object param0, + .method private hidebysig static void 'b__5'(object param0, class [mscorlib]System.EventArgs param1) cil managed { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -2243,9 +2914,9 @@ .maxstack 8 IL_0000: call void [mscorlib]System.Console::WriteLine() IL_0005: ret - } // end of method TestCases::'b__8' + } // end of method TestCases::'b__5' - .method private hidebysig static bool 'b__1c'(class [mscorlib]System.Globalization.NumberFormatInfo format) cil managed + .method private hidebysig static bool 'b__19'(class [mscorlib]System.Globalization.NumberFormatInfo format) cil managed { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 17 (0x11) @@ -2256,11 +2927,123 @@ IL_000b: call bool [mscorlib]System.String::op_Equality(string, string) IL_0010: ret - } // end of method TestCases::'b__1c' + } // end of method TestCases::'b__19' } // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases +.class private auto ansi '' + extends [mscorlib]System.Object +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=40' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 40 + } // end of class '__StaticArrayInitTypeSize=40' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=24' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 24 + } // end of class '__StaticArrayInitTypeSize=24' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=10' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 10 + } // end of class '__StaticArrayInitTypeSize=10' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=12' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 12 + } // end of class '__StaticArrayInitTypeSize=12' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=80' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 80 + } // end of class '__StaticArrayInitTypeSize=80' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=48' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 48 + } // end of class '__StaticArrayInitTypeSize=48' + + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=40' '$$method0x600000a-1' at I_00002070 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=40' '$$method0x600000c-1' at I_000020E8 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=24' '$$method0x600000c-2' at I_00002110 + .field static assembly int64 '$$method0x600000f-1' at I_000023D0 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=10' '$$method0x6000010-1' at I_000023F8 + .field static assembly int64 '$$method0x6000011-1' at I_00002420 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=10' '$$method0x6000012-1' at I_00002448 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=12' '$$method0x6000013-1' at I_00002470 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=40' '$$method0x6000014-1' at I_000024A0 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=40' '$$method0x6000015-1' at I_000024E8 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=40' '$$method0x6000016-1' at I_00002530 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=80' '$$method0x6000017-1' at I_00002578 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=24' '$$method0x6000018-1' at I_000025E8 + .field static assembly valuetype ''/'__StaticArrayInitTypeSize=48' '$$method0x6000019-1' at I_00002620 +} // end of class '' + // ============================================================= +.data cil I_00002070 = bytearray ( + 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 + 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_000020E8 = bytearray ( + 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 + 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_00002110 = bytearray ( + 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 + 05 00 00 00 06 00 00 00) +.data cil I_00002128 = int8[8] +.data cil I_000023D0 = bytearray ( + 01 00 01 00 00 00 01 01) +.data cil I_000023F8 = bytearray ( + 01 02 03 04 05 06 07 08 FE FF) +.data cil I_00002402 = int8[30] +.data cil I_00002420 = bytearray ( + 80 81 00 01 02 03 04 7F) +.data cil I_00002448 = bytearray ( + 00 80 FF FF 00 00 01 00 FF 7F) +.data cil I_00002452 = int8[14] +.data cil I_00002470 = bytearray ( + 00 00 01 00 FF 7F 00 80 FE FF FF FF) +.data cil I_0000247C = int8[4] +.data cil I_000024A0 = bytearray ( + 01 00 00 00 FE FF FF FF 00 94 35 77 04 00 00 00 // ..........5w.... + 05 00 00 00 FA FF FF FF 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_000024E8 = bytearray ( + 01 00 00 00 00 94 35 77 00 5E D0 B2 04 00 00 00 // ......5w.^...... + 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_00002530 = bytearray ( + 01 00 0C BB 7D 6E 9C BA FF FF FF FF FF FF FF FF // ....}n.......... + 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 + FF FF F3 44 82 91 63 45) // ...D..cE +.data cil I_00002578 = bytearray ( + 01 00 00 00 00 00 00 00 00 94 35 77 00 00 00 00 // ..........5w.... + 00 5E D0 B2 00 00 00 00 04 00 00 00 00 00 00 00 // .^.............. + 05 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 + 07 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 + FF FF F3 44 82 91 63 45 FF FF E7 89 04 23 C7 8A) // ...D..cE.....#.. +.data cil I_000025E8 = bytearray ( + 00 00 C0 BF 00 00 00 00 00 00 C0 3F 00 00 80 FF // ...........?.... + 00 00 80 7F 00 00 C0 FF) +.data cil I_00002620 = bytearray ( + 00 00 00 00 00 00 F8 BF 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 F8 3F 00 00 00 00 00 00 F0 FF // .......?........ + 00 00 00 00 00 00 F0 7F 00 00 00 00 00 00 F8 FF) // *********** DISASSEMBLY COMPLETE *********************** diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.roslyn.il index 91e9772e6..10df11eba 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.roslyn.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.roslyn.il @@ -1159,8 +1159,8 @@ { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .field public static initonly class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c' '<>9' - .field public static class [mscorlib]System.EventHandler '<>9__33_0' - .field public static class [mscorlib]System.Func`2 '<>9__53_0' + .field public static class [mscorlib]System.EventHandler '<>9__51_0' + .field public static class [mscorlib]System.Func`2 '<>9__65_0' .method private hidebysig specialname rtspecialname static void .cctor() cil managed { @@ -1182,17 +1182,17 @@ } // end of method '<>c'::.ctor .method assembly hidebysig instance void - 'b__33_0'(object '', + 'b__51_0'(object '', class [mscorlib]System.EventArgs '') cil managed { // Code size 6 (0x6) .maxstack 8 IL_0000: call void [mscorlib]System.Console::WriteLine() IL_0005: ret - } // end of method '<>c'::'b__33_0' + } // end of method '<>c'::'b__51_0' .method assembly hidebysig instance bool - 'b__53_0'(class [mscorlib]System.Globalization.NumberFormatInfo format) cil managed + 'b__65_0'(class [mscorlib]System.Globalization.NumberFormatInfo format) cil managed { // Code size 17 (0x11) .maxstack 8 @@ -1202,7 +1202,7 @@ IL_000b: call bool [mscorlib]System.String::op_Equality(string, string) IL_0010: ret - } // end of method '<>c'::'b__53_0' + } // end of method '<>c'::'b__65_0' } // end of class '<>c' @@ -1241,922 +1241,1657 @@ IL_0001: ret } // end of method TestCases::TestCall - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test1() cil managed - { - // Code size 34 (0x22) - .maxstack 8 - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0005: dup - IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000b: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_0010: dup - IL_0011: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_0016: ldc.i4.1 - IL_0017: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_001c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0021: ret - } // end of method TestCases::Test1 - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test1Alternative() cil managed + .method private hidebysig static int32 + GetInt() cil managed { - // Code size 35 (0x23) + // Code size 2 (0x2) .maxstack 8 IL_0000: ldc.i4.1 - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0006: dup - IL_0007: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000c: dup - IL_000d: ldc.i4.1 - IL_000e: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_0013: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0018: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_001d: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) - IL_0022: ret - } // end of method TestCases::Test1Alternative + IL_0001: ret + } // end of method TestCases::GetInt - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test2() cil managed + .method private hidebysig static string + GetString() cil managed { - // Code size 20 (0x14) + // Code size 6 (0x6) .maxstack 8 - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0005: dup - IL_0006: ldc.i4.1 - IL_0007: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_000c: dup - IL_000d: ldc.i4.2 - IL_000e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_0013: ret - } // end of method TestCases::Test2 + IL_0000: ldstr "Test" + IL_0005: ret + } // end of method TestCases::GetString - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test3() cil managed + .method private hidebysig static void NoOp(valuetype [mscorlib]System.Nullable`1[] 'array') cil managed { - // Code size 30 (0x1e) + // Code size 1 (0x1) .maxstack 8 - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0005: dup - IL_0006: ldc.i4.1 - IL_0007: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_000c: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0011: dup - IL_0012: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0017: ldc.i4.2 - IL_0018: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_001d: ret - } // end of method TestCases::Test3 + IL_0000: ret + } // end of method TestCases::NoOp - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test3b() cil managed + .method private hidebysig instance void + Data_TestEvent(object sender, + class [mscorlib]System.EventArgs e) cil managed { - // Code size 31 (0x1f) + // Code size 6 (0x6) .maxstack 8 - IL_0000: ldc.i4.0 - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0006: dup - IL_0007: ldc.i4.1 - IL_0008: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_000d: dup - IL_000e: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0013: ldc.i4.2 - IL_0014: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_0019: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) - IL_001e: ret - } // end of method TestCases::Test3b + IL_0000: newobj instance void [mscorlib]System.NotImplementedException::.ctor() + IL_0005: throw + } // end of method TestCases::Data_TestEvent - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test4() cil managed + .method public hidebysig static void Array1() cil managed { - // Code size 37 (0x25) + // Code size 29 (0x1d) .maxstack 8 - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0005: dup - IL_0006: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_000b: ldc.i4.1 - IL_000c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_0011: dup - IL_0012: ldc.i4.2 - IL_0013: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_0018: dup - IL_0019: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_001e: ldc.i4.3 - IL_001f: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::B - IL_0024: ret - } // end of method TestCases::Test4 - - .method public hidebysig static void InvalidIndices(int32 a) cil managed - { - // Code size 23 (0x17) - .maxstack 3 - .locals init (int32[] V_0) - IL_0000: ldc.i4.1 - IL_0001: newarr [mscorlib]System.Int32 - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.1 - IL_0009: ldarg.0 - IL_000a: stelem.i4 - IL_000b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0010: ldloc.0 - IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0016: ret - } // end of method TestCases::InvalidIndices - - .method public hidebysig static void InvalidIndices2(int32 a) cil managed - { - // Code size 23 (0x17) - .maxstack 3 - .locals init (int32[] V_0) - IL_0000: ldc.i4.1 - IL_0001: newarr [mscorlib]System.Int32 - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.m1 - IL_0009: ldarg.0 - IL_000a: stelem.i4 - IL_000b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0010: ldloc.0 - IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.s 10 + IL_0007: newarr [mscorlib]System.Int32 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::E0D2592373A0C161E56E266306CD8405CD719D19 + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0016: ret - } // end of method TestCases::InvalidIndices2 + IL_001c: ret + } // end of method TestCases::Array1 - .method public hidebysig static void IndicesInWrongOrder(int32 a, - int32 b) cil managed + .method public hidebysig static void Array2(int32 a, + int32 b, + int32 c) cil managed { - // Code size 27 (0x1b) - .maxstack 3 - .locals init (int32[] V_0) - IL_0000: ldc.i4.5 - IL_0001: newarr [mscorlib]System.Int32 - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.2 - IL_0009: ldarg.1 - IL_000a: stelem.i4 - IL_000b: ldloc.0 - IL_000c: ldc.i4.1 + // Code size 29 (0x1d) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.5 + IL_0006: newarr [mscorlib]System.Int32 + IL_000b: dup + IL_000c: ldc.i4.0 IL_000d: ldarg.0 IL_000e: stelem.i4 - IL_000f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0014: ldloc.0 - IL_0015: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_000f: dup + IL_0010: ldc.i4.2 + IL_0011: ldarg.1 + IL_0012: stelem.i4 + IL_0013: dup + IL_0014: ldc.i4.4 + IL_0015: ldarg.2 + IL_0016: stelem.i4 + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_001a: ret - } // end of method TestCases::IndicesInWrongOrder + IL_001c: ret + } // end of method TestCases::Array2 - .method public hidebysig static void ExtensionMethodInCollectionInitializer() cil managed + .method public hidebysig static void NestedArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 38 (0x26) - .maxstack 6 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) + // Code size 79 (0x4f) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldc.i4.2 - IL_000d: newarr [mscorlib]System.Int32 - IL_0012: dup - IL_0013: ldc.i4.0 - IL_0014: ldc.i4.1 - IL_0015: stelem.i4 - IL_0016: dup - IL_0017: ldc.i4.1 - IL_0018: ldc.i4.2 - IL_0019: stelem.i4 - IL_001a: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) - IL_001f: ldloc.0 - IL_0020: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.3 + IL_0006: newarr int32[] + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: ldc.i4.s 10 + IL_000f: newarr [mscorlib]System.Int32 + IL_0014: dup + IL_0015: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::E0D2592373A0C161E56E266306CD8405CD719D19 + IL_001a: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_001f: stelem.ref + IL_0020: dup + IL_0021: ldc.i4.1 + IL_0022: ldc.i4.3 + IL_0023: newarr [mscorlib]System.Int32 + IL_0028: dup + IL_0029: ldc.i4.0 + IL_002a: ldarg.0 + IL_002b: stelem.i4 + IL_002c: dup + IL_002d: ldc.i4.1 + IL_002e: ldarg.1 + IL_002f: stelem.i4 + IL_0030: dup + IL_0031: ldc.i4.2 + IL_0032: ldarg.2 + IL_0033: stelem.i4 + IL_0034: stelem.ref + IL_0035: dup + IL_0036: ldc.i4.2 + IL_0037: ldc.i4.6 + IL_0038: newarr [mscorlib]System.Int32 + IL_003d: dup + IL_003e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=24' ''::C4E70AB31EF6C8908F896CAD1C6BC75F7FA65E27 + IL_0043: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0048: stelem.ref + IL_0049: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0025: ret - } // end of method TestCases::ExtensionMethodInCollectionInitializer + IL_004e: ret + } // end of method TestCases::NestedArray - .method public hidebysig static void NoCollectionInitializerBecauseOfTypeArguments() cil managed + .method public hidebysig static void NestedNullableArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 22 (0x16) + // Code size 295 (0x127) .maxstack 8 - IL_0000: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_0005: dup - IL_0006: ldstr "int" - IL_000b: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(string) - IL_0010: call void [mscorlib]System.Console::WriteLine(object) - IL_0015: ret - } // end of method TestCases::NoCollectionInitializerBecauseOfTypeArguments + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.3 + IL_0006: newarr valuetype [mscorlib]System.Nullable`1[] + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: ldc.i4.s 11 + IL_000f: newarr valuetype [mscorlib]System.Nullable`1 + IL_0014: dup + IL_0015: ldc.i4.0 + IL_0016: ldc.i4.1 + IL_0017: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_001c: stelem valuetype [mscorlib]System.Nullable`1 + IL_0021: dup + IL_0022: ldc.i4.1 + IL_0023: ldc.i4.2 + IL_0024: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0029: stelem valuetype [mscorlib]System.Nullable`1 + IL_002e: dup + IL_002f: ldc.i4.2 + IL_0030: ldc.i4.3 + IL_0031: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0036: stelem valuetype [mscorlib]System.Nullable`1 + IL_003b: dup + IL_003c: ldc.i4.3 + IL_003d: ldc.i4.4 + IL_003e: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0043: stelem valuetype [mscorlib]System.Nullable`1 + IL_0048: dup + IL_0049: ldc.i4.4 + IL_004a: ldc.i4.5 + IL_004b: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0050: stelem valuetype [mscorlib]System.Nullable`1 + IL_0055: dup + IL_0056: ldc.i4.5 + IL_0057: ldc.i4.6 + IL_0058: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_005d: stelem valuetype [mscorlib]System.Nullable`1 + IL_0062: dup + IL_0063: ldc.i4.6 + IL_0064: ldc.i4.7 + IL_0065: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_006a: stelem valuetype [mscorlib]System.Nullable`1 + IL_006f: dup + IL_0070: ldc.i4.7 + IL_0071: ldc.i4.8 + IL_0072: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0077: stelem valuetype [mscorlib]System.Nullable`1 + IL_007c: dup + IL_007d: ldc.i4.8 + IL_007e: ldc.i4.s 9 + IL_0080: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0085: stelem valuetype [mscorlib]System.Nullable`1 + IL_008a: dup + IL_008b: ldc.i4.s 9 + IL_008d: ldc.i4.s 10 + IL_008f: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0094: stelem valuetype [mscorlib]System.Nullable`1 + IL_0099: stelem.ref + IL_009a: dup + IL_009b: ldc.i4.1 + IL_009c: ldc.i4.4 + IL_009d: newarr valuetype [mscorlib]System.Nullable`1 + IL_00a2: dup + IL_00a3: ldc.i4.0 + IL_00a4: ldarg.0 + IL_00a5: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00aa: stelem valuetype [mscorlib]System.Nullable`1 + IL_00af: dup + IL_00b0: ldc.i4.1 + IL_00b1: ldarg.1 + IL_00b2: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00b7: stelem valuetype [mscorlib]System.Nullable`1 + IL_00bc: dup + IL_00bd: ldc.i4.2 + IL_00be: ldarg.2 + IL_00bf: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00c4: stelem valuetype [mscorlib]System.Nullable`1 + IL_00c9: stelem.ref + IL_00ca: dup + IL_00cb: ldc.i4.2 + IL_00cc: ldc.i4.7 + IL_00cd: newarr valuetype [mscorlib]System.Nullable`1 + IL_00d2: dup + IL_00d3: ldc.i4.0 + IL_00d4: ldc.i4.1 + IL_00d5: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00da: stelem valuetype [mscorlib]System.Nullable`1 + IL_00df: dup + IL_00e0: ldc.i4.1 + IL_00e1: ldc.i4.2 + IL_00e2: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00e7: stelem valuetype [mscorlib]System.Nullable`1 + IL_00ec: dup + IL_00ed: ldc.i4.2 + IL_00ee: ldc.i4.3 + IL_00ef: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00f4: stelem valuetype [mscorlib]System.Nullable`1 + IL_00f9: dup + IL_00fa: ldc.i4.3 + IL_00fb: ldc.i4.4 + IL_00fc: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0101: stelem valuetype [mscorlib]System.Nullable`1 + IL_0106: dup + IL_0107: ldc.i4.4 + IL_0108: ldc.i4.5 + IL_0109: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_010e: stelem valuetype [mscorlib]System.Nullable`1 + IL_0113: dup + IL_0114: ldc.i4.5 + IL_0115: ldc.i4.6 + IL_0116: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_011b: stelem valuetype [mscorlib]System.Nullable`1 + IL_0120: stelem.ref + IL_0121: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0126: ret + } // end of method TestCases::NestedNullableArray - .method public hidebysig static void CollectionInitializerWithParamsMethod() cil managed + .method public hidebysig static void NestedPointerArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 42 (0x2a) - .maxstack 5 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) + // Code size 74 (0x4a) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_000a: stloc.0 - IL_000b: ldloc.0 - IL_000c: ldc.i4.s 10 - IL_000e: newarr [mscorlib]System.Int32 + IL_0005: ldc.i4.3 + IL_0006: newarr void*[] + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: ldc.i4.1 + IL_000e: newarr void* IL_0013: dup - IL_0014: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::E0D2592373A0C161E56E266306CD8405CD719D19 - IL_0019: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, - valuetype [mscorlib]System.RuntimeFieldHandle) - IL_001e: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) - IL_0023: ldloc.0 - IL_0024: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0014: ldc.i4.0 + IL_0015: ldc.i4.0 + IL_0016: conv.u + IL_0017: stelem.i + IL_0018: stelem.ref + IL_0019: dup + IL_001a: ldc.i4.1 + IL_001b: ldc.i4.2 + IL_001c: newarr void* + IL_0021: dup + IL_0022: ldc.i4.0 + IL_0023: ldc.i4 0xc8 + IL_0028: conv.i + IL_0029: stelem.i + IL_002a: dup + IL_002b: ldc.i4.1 + IL_002c: ldc.i4.0 + IL_002d: conv.u + IL_002e: stelem.i + IL_002f: stelem.ref + IL_0030: dup + IL_0031: ldc.i4.2 + IL_0032: ldc.i4.2 + IL_0033: newarr void* + IL_0038: dup + IL_0039: ldc.i4.0 + IL_003a: ldc.i4.s 100 + IL_003c: conv.i + IL_003d: stelem.i + IL_003e: dup + IL_003f: ldc.i4.1 + IL_0040: ldc.i4.0 + IL_0041: conv.u + IL_0042: stelem.i + IL_0043: stelem.ref + IL_0044: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0029: ret - } // end of method TestCases::CollectionInitializerWithParamsMethod + IL_0049: ret + } // end of method TestCases::NestedPointerArray - .method public hidebysig static void CollectionInitializerList() cil managed + .method public hidebysig static void ArrayBoolean() cil managed { - // Code size 37 (0x25) + // Code size 28 (0x1c) .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000a: dup - IL_000b: ldc.i4.1 - IL_000c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0011: dup - IL_0012: ldc.i4.2 - IL_0013: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0018: dup - IL_0019: ldc.i4.3 - IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.8 + IL_0006: newarr [mscorlib]System.Boolean + IL_000b: dup + IL_000c: ldtoken field int64 ''::EB0715DBB235F3F696F2C404F5839C6650640898 + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0024: ret - } // end of method TestCases::CollectionInitializerList + IL_001b: ret + } // end of method TestCases::ArrayBoolean - .method public hidebysig static object - RecursiveCollectionInitializer() cil managed + .method public hidebysig static void ArrayByte() cil managed { - // Code size 13 (0xd) + // Code size 29 (0x1d) .maxstack 8 - IL_0000: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0005: dup - IL_0006: dup - IL_0007: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_000c: ret - } // end of method TestCases::RecursiveCollectionInitializer + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.s 10 + IL_0007: newarr [mscorlib]System.Byte + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=10' ''::'20E3FF489634E18F3F7EB292AD504DBAE9519293' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001c: ret + } // end of method TestCases::ArrayByte - .method public hidebysig static void CollectionInitializerDictionary() cil managed + .method public hidebysig static void ArraySByte() cil managed { - // Code size 52 (0x34) + // Code size 28 (0x1c) .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() - IL_000a: dup - IL_000b: ldstr "First" - IL_0010: ldc.i4.1 - IL_0011: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0016: dup - IL_0017: ldstr "Second" - IL_001c: ldc.i4.2 - IL_001d: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0022: dup - IL_0023: ldstr "Third" - IL_0028: ldc.i4.3 - IL_0029: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_002e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.8 + IL_0006: newarr [mscorlib]System.SByte + IL_000b: dup + IL_000c: ldtoken field int64 ''::A6296CAC471BE2954899600137940479D8073C7C + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0033: ret - } // end of method TestCases::CollectionInitializerDictionary + IL_001b: ret + } // end of method TestCases::ArraySByte - .method public hidebysig static void CollectionInitializerDictionaryWithEnumTypes() cil managed + .method public hidebysig static void ArrayShort() cil managed { - // Code size 32 (0x20) + // Code size 28 (0x1c) .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() - IL_000a: dup - IL_000b: ldc.i4.0 - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0012: dup - IL_0013: ldc.i4.1 - IL_0014: ldc.i4.1 - IL_0015: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_001a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.5 + IL_0006: newarr [mscorlib]System.Int16 + IL_000b: dup + IL_000c: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=10' ''::'56D9EEC8EF899644C40B9BE9D886DF2367A5D078' + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_001f: ret - } // end of method TestCases::CollectionInitializerDictionaryWithEnumTypes + IL_001b: ret + } // end of method TestCases::ArrayShort - .method public hidebysig static void NotACollectionInitializer() cil managed + .method public hidebysig static void ArrayUShort() cil managed { - // Code size 39 (0x27) - .maxstack 2 - .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) - IL_0000: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldc.i4.1 - IL_0008: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_000d: ldloc.0 - IL_000e: ldc.i4.2 - IL_000f: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0014: ldloc.0 - IL_0015: ldc.i4.3 - IL_0016: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0020: ldloc.0 - IL_0021: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + // Code size 28 (0x1c) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.6 + IL_0006: newarr [mscorlib]System.UInt16 + IL_000b: dup + IL_000c: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=12' ''::'735E5A21849E86F68D220F06163E8C5C6376B9C9' + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0026: ret - } // end of method TestCases::NotACollectionInitializer + IL_001b: ret + } // end of method TestCases::ArrayUShort - .method public hidebysig static void ObjectInitializer() cil managed + .method public hidebysig static void ArrayInt() cil managed { - // Code size 23 (0x17) + // Code size 29 (0x1d) .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: dup - IL_000b: ldc.i4.0 - IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.s 10 + IL_0007: newarr [mscorlib]System.Int32 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::F514FF55B79BCAA2CEC9B56C062D976E45F89AB7 + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0016: ret - } // end of method TestCases::ObjectInitializer + IL_001c: ret + } // end of method TestCases::ArrayInt - .method public hidebysig static void NotAnObjectInitializer() cil managed + .method public hidebysig static void ArrayUInt() cil managed { - // Code size 25 (0x19) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldc.i4.0 - IL_0008: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_000d: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0012: ldloc.0 - IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + // Code size 29 (0x1d) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.s 10 + IL_0007: newarr [mscorlib]System.UInt32 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::B9583930B842DBCEF0D7B8E57D4D3F1E8055C39E + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0018: ret - } // end of method TestCases::NotAnObjectInitializer + IL_001c: ret + } // end of method TestCases::ArrayUInt - .method public hidebysig static void NotAnObjectInitializerWithEvent() cil managed + .method public hidebysig static void ArrayLong() cil managed { - // Code size 55 (0x37) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__33_0' - IL_000c: dup - IL_000d: brtrue.s IL_0026 - - IL_000f: pop - IL_0010: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9' - IL_0015: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'b__33_0'(object, - class [mscorlib]System.EventArgs) - IL_001b: newobj instance void [mscorlib]System.EventHandler::.ctor(object, - native int) - IL_0020: dup - IL_0021: stsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__33_0' - IL_0026: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) - IL_002b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0030: ldloc.0 - IL_0031: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + // Code size 28 (0x1c) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.5 + IL_0006: newarr [mscorlib]System.Int64 + IL_000b: dup + IL_000c: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'8D903ECAD8D9D75B3183B23AF79F6D2E607369E3' + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0036: ret - } // end of method TestCases::NotAnObjectInitializerWithEvent + IL_001b: ret + } // end of method TestCases::ArrayLong - .method public hidebysig static void ObjectInitializerAssignCollectionToField() cil managed + .method public hidebysig static void ArrayULong() cil managed { - // Code size 48 (0x30) + // Code size 29 (0x1d) .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: dup - IL_000b: ldc.i4.0 - IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0011: dup - IL_0012: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0017: dup - IL_0018: ldc.i4.0 - IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001e: dup - IL_001f: ldc.i4.1 - IL_0020: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0025: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_002a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.s 10 + IL_0007: newarr [mscorlib]System.UInt64 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=80' ''::'9B1F6E56D755443CC39C1969CE38FD41FD4EF4B7' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002f: ret - } // end of method TestCases::ObjectInitializerAssignCollectionToField + IL_001c: ret + } // end of method TestCases::ArrayULong - .method public hidebysig static void ObjectInitializerAddToCollectionInField() cil managed + .method public hidebysig static void ArrayFloat() cil managed { - // Code size 47 (0x2f) + // Code size 28 (0x1c) .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: dup - IL_000b: ldc.i4.0 - IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0011: dup - IL_0012: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0017: ldc.i4.0 - IL_0018: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001d: dup - IL_001e: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0023: ldc.i4.1 - IL_0024: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0029: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.6 + IL_0006: newarr [mscorlib]System.Single + IL_000b: dup + IL_000c: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=24' ''::FBCB49C1A244C1B5781AA1DB02C5A11F68908526 + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002e: ret - } // end of method TestCases::ObjectInitializerAddToCollectionInField + IL_001b: ret + } // end of method TestCases::ArrayFloat - .method public hidebysig static void ObjectInitializerAssignCollectionToProperty() cil managed + .method public hidebysig static void ArrayDouble() cil managed { - // Code size 48 (0x30) + // Code size 28 (0x1c) .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: dup - IL_000b: ldc.i4.0 - IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0011: dup - IL_0012: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0017: dup - IL_0018: ldc.i4.0 - IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001e: dup - IL_001f: ldc.i4.1 - IL_0020: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0025: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_PropertyList(class [mscorlib]System.Collections.Generic.List`1) - IL_002a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.6 + IL_0006: newarr [mscorlib]System.Double + IL_000b: dup + IL_000c: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=48' ''::DC7043B0114737ACE19A23DD755893795FD48A23 + IL_0011: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002f: ret - } // end of method TestCases::ObjectInitializerAssignCollectionToProperty + IL_001b: ret + } // end of method TestCases::ArrayDouble - .method public hidebysig static void ObjectInitializerAddToCollectionInProperty() cil managed + .method public hidebysig static void ArrayDecimal() cil managed { - // Code size 47 (0x2f) - .maxstack 8 + // Code size 96 (0x60) + .maxstack 9 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: dup - IL_000b: ldc.i4.0 - IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0011: dup - IL_0012: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() - IL_0017: ldc.i4.0 - IL_0018: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001d: dup - IL_001e: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() - IL_0023: ldc.i4.1 - IL_0024: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0029: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.6 + IL_0006: newarr [mscorlib]System.Decimal + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: ldc.i4.s -100 + IL_000f: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0014: stelem [mscorlib]System.Decimal + IL_0019: dup + IL_001a: ldc.i4.2 + IL_001b: ldc.i4.s 100 + IL_001d: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0022: stelem [mscorlib]System.Decimal + IL_0027: dup + IL_0028: ldc.i4.3 + IL_0029: ldc.i4.m1 + IL_002a: ldc.i4.m1 + IL_002b: ldc.i4.m1 + IL_002c: ldc.i4.1 + IL_002d: ldc.i4.0 + IL_002e: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_0033: stelem [mscorlib]System.Decimal + IL_0038: dup + IL_0039: ldc.i4.4 + IL_003a: ldc.i4.m1 + IL_003b: ldc.i4.m1 + IL_003c: ldc.i4.m1 + IL_003d: ldc.i4.0 + IL_003e: ldc.i4.0 + IL_003f: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_0044: stelem [mscorlib]System.Decimal + IL_0049: dup + IL_004a: ldc.i4.5 + IL_004b: ldc.i4.1 + IL_004c: ldc.i4.0 + IL_004d: ldc.i4.0 + IL_004e: ldc.i4.0 + IL_004f: ldc.i4.7 + IL_0050: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_0055: stelem [mscorlib]System.Decimal + IL_005a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002e: ret - } // end of method TestCases::ObjectInitializerAddToCollectionInProperty + IL_005f: ret + } // end of method TestCases::ArrayDecimal - .method public hidebysig static void ObjectInitializerWithInitializationOfNestedObjects() cil managed + .method public hidebysig static void ArrayString() cil managed { - // Code size 45 (0x2d) + // Code size 41 (0x29) .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: dup - IL_000b: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0010: ldc.i4.0 - IL_0011: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0016: dup - IL_0017: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_001c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0021: ldc.i4.1 - IL_0022: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0027: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: ldc.i4.4 + IL_0006: newarr [mscorlib]System.String + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: ldstr "" + IL_0012: stelem.ref + IL_0013: dup + IL_0014: ldc.i4.2 + IL_0015: ldstr "Hello" + IL_001a: stelem.ref + IL_001b: dup + IL_001c: ldc.i4.3 + IL_001d: ldstr "World" + IL_0022: stelem.ref + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002c: ret - } // end of method TestCases::ObjectInitializerWithInitializationOfNestedObjects + IL_0028: ret + } // end of method TestCases::ArrayString - .method private hidebysig static int32 - GetInt() cil managed + .method public hidebysig static void ArrayEnum() cil managed { - // Code size 2 (0x2) + // Code size 25 (0x19) .maxstack 8 - IL_0000: ldc.i4.1 - IL_0001: ret - } // end of method TestCases::GetInt + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldc.i4.4 + IL_0006: newarr ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum + IL_000b: dup + IL_000c: ldc.i4.1 + IL_000d: ldc.i4.1 + IL_000e: stelem.i4 + IL_000f: dup + IL_0010: ldc.i4.3 + IL_0011: ldc.i4.1 + IL_0012: stelem.i4 + IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0018: ret + } // end of method TestCases::ArrayEnum - .method private hidebysig static string - GetString() cil managed + .method public hidebysig static void RecursiveArrayInitializer() cil managed { - // Code size 6 (0x6) - .maxstack 8 - IL_0000: ldstr "Test" - IL_0005: ret - } // end of method TestCases::GetString + // Code size 28 (0x1c) + .maxstack 4 + .locals init (int32[] V_0) + IL_0000: ldc.i4.3 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.0 + IL_0009: ldc.i4.1 + IL_000a: stelem.i4 + IL_000b: ldloc.0 + IL_000c: ldc.i4.1 + IL_000d: ldc.i4.2 + IL_000e: stelem.i4 + IL_000f: ldloc.0 + IL_0010: ldc.i4.2 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: ldelem.i4 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: stelem.i4 + IL_0017: ldloc.0 + IL_0018: ldc.i4.0 + IL_0019: ldc.i4.0 + IL_001a: stelem.i4 + IL_001b: ret + } // end of method TestCases::RecursiveArrayInitializer - .method private hidebysig static void NoOp(valuetype [mscorlib]System.Nullable`1[] 'array') cil managed + .method public hidebysig static void InvalidIndices(int32 a) cil managed { - // Code size 1 (0x1) - .maxstack 8 - IL_0000: ret - } // end of method TestCases::NoOp + // Code size 23 (0x17) + .maxstack 3 + .locals init (int32[] V_0) + IL_0000: ldc.i4.1 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.1 + IL_0009: ldarg.0 + IL_000a: stelem.i4 + IL_000b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0010: ldloc.0 + IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0016: ret + } // end of method TestCases::InvalidIndices - .method public hidebysig static void SimpleDictInitializer() cil managed + .method public hidebysig static void InvalidIndices2(int32 a) cil managed { - // Code size 41 (0x29) - .maxstack 8 - IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: dup - IL_000b: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0010: ldc.i4.0 - IL_0011: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0016: dup - IL_0017: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_001c: ldc.i4.2 - IL_001d: ldnull - IL_001e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) - IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + // Code size 23 (0x17) + .maxstack 3 + .locals init (int32[] V_0) + IL_0000: ldc.i4.1 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.m1 + IL_0009: ldarg.0 + IL_000a: stelem.i4 + IL_000b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0010: ldloc.0 + IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0028: ret - } // end of method TestCases::SimpleDictInitializer + IL_0016: ret + } // end of method TestCases::InvalidIndices2 - .method public hidebysig static void MixedObjectAndDictInitializer() cil managed + .method public hidebysig static void IndicesInWrongOrder(int32 a, + int32 b) cil managed { - // Code size 130 (0x82) - .maxstack 6 - .locals init (int32 V_0, - int32 V_1, - string V_2) - IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: dup - IL_000b: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0010: ldc.i4.0 - IL_0011: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0016: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetInt() - IL_001b: stloc.0 - IL_001c: dup - IL_001d: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0022: ldloc.0 - IL_0023: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) - IL_0028: ldc.i4.1 - IL_0029: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_002e: dup - IL_002f: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0034: ldloc.0 - IL_0035: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) - IL_003a: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_003f: ldc.i4.0 - IL_0040: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0045: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetInt() - IL_004a: stloc.1 - IL_004b: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetString() - IL_0050: stloc.2 - IL_0051: dup - IL_0052: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0057: ldloc.0 - IL_0058: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) - IL_005d: ldloc.1 - IL_005e: ldloc.2 - IL_005f: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0064: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, - string, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) - IL_0069: dup - IL_006a: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_006f: ldloc.0 - IL_0070: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) - IL_0075: ldc.i4.2 - IL_0076: ldnull - IL_0077: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) - IL_007c: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + // Code size 27 (0x1b) + .maxstack 3 + .locals init (int32[] V_0) + IL_0000: ldc.i4.5 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.2 + IL_0009: ldarg.1 + IL_000a: stelem.i4 + IL_000b: ldloc.0 + IL_000c: ldc.i4.1 + IL_000d: ldarg.0 + IL_000e: stelem.i4 + IL_000f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0014: ldloc.0 + IL_0015: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0081: ret - } // end of method TestCases::MixedObjectAndDictInitializer + IL_001a: ret + } // end of method TestCases::IndicesInWrongOrder - .method private hidebysig instance void - NestedListWithIndexInitializer(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum myEnum) cil managed + .method public hidebysig static void Issue953_MissingNullableSpecifierForArrayInitializer() cil managed { - // Code size 59 (0x3b) + // Code size 29 (0x1d) .maxstack 8 - IL_0000: newobj instance void class [mscorlib]System.Collections.Generic.List`1>::.ctor() - IL_0005: dup - IL_0006: ldc.i4.0 - IL_0007: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) - IL_000c: ldc.i4.1 - IL_000d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0012: dup - IL_0013: ldc.i4.0 - IL_0014: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) - IL_0019: ldc.i4.2 - IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001f: dup - IL_0020: ldc.i4.0 - IL_0021: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) - IL_0026: ldc.i4.3 - IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002c: dup - IL_002d: ldc.i4.1 - IL_002e: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) - IL_0033: ldarg.1 - IL_0034: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0039: pop - IL_003a: ret - } // end of method TestCases::NestedListWithIndexInitializer + IL_0000: ldc.i4.1 + IL_0001: newarr valuetype [mscorlib]System.Nullable`1 + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldsfld valuetype [mscorlib]System.Guid [mscorlib]System.Guid::Empty + IL_000d: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0012: stelem valuetype [mscorlib]System.Nullable`1 + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::NoOp(valuetype [mscorlib]System.Nullable`1[]) + IL_001c: ret + } // end of method TestCases::Issue953_MissingNullableSpecifierForArrayInitializer - .method public hidebysig static void ObjectInitializerWithInitializationOfDeeplyNestedObjects() cil managed + .method private hidebysig instance void + Issue907_Test3(string text) cil managed { - // Code size 77 (0x4d) - .maxstack 4 + // Code size 28 (0x1c) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() IL_000a: dup - IL_000b: ldc.i4.1 - IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0011: dup - IL_0012: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0017: ldc.i4.0 - IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_001d: dup - IL_001e: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0023: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0028: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_002d: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0032: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0037: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_003c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0041: ldc.i4.1 - IL_0042: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0047: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_000b: ldstr "" + IL_0010: ldarg.1 + IL_0011: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_004c: ret - } // end of method TestCases::ObjectInitializerWithInitializationOfDeeplyNestedObjects + IL_001b: ret + } // end of method TestCases::Issue907_Test3 - .method public hidebysig static void CollectionInitializerInsideObjectInitializers() cil managed + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test1() cil managed { - // Code size 53 (0x35) + // Code size 34 (0x22) .maxstack 8 - IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000a: dup - IL_000b: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0005: dup + IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000b: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L IL_0010: dup - IL_0011: ldc.i4.0 - IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0017: dup - IL_0018: ldc.i4.1 - IL_0019: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_b(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_001e: dup - IL_001f: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() - IL_0024: ldc.i4.0 - IL_0025: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002a: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_MoreData(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) - IL_002f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0011: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_0016: ldc.i4.1 + IL_0017: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_001c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0021: ret + } // end of method TestCases::Test1 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test1Alternative() cil managed + { + // Code size 35 (0x23) + .maxstack 8 + IL_0000: ldc.i4.1 + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: dup + IL_0007: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000c: dup + IL_000d: ldc.i4.1 + IL_000e: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_0013: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0018: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_001d: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) + IL_0022: ret + } // end of method TestCases::Test1Alternative + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test2() cil managed + { + // Code size 20 (0x14) + .maxstack 8 + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0005: dup + IL_0006: ldc.i4.1 + IL_0007: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_000c: dup + IL_000d: ldc.i4.2 + IL_000e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_0013: ret + } // end of method TestCases::Test2 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test3() cil managed + { + // Code size 30 (0x1e) + .maxstack 8 + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0005: dup + IL_0006: ldc.i4.1 + IL_0007: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_000c: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0011: dup + IL_0012: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0017: ldc.i4.2 + IL_0018: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_001d: ret + } // end of method TestCases::Test3 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test3b() cil managed + { + // Code size 31 (0x1f) + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: dup + IL_0007: ldc.i4.1 + IL_0008: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_000d: dup + IL_000e: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0013: ldc.i4.2 + IL_0014: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_0019: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) + IL_001e: ret + } // end of method TestCases::Test3b + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test4() cil managed + { + // Code size 37 (0x25) + .maxstack 8 + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0005: dup + IL_0006: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_000b: ldc.i4.1 + IL_000c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_0011: dup + IL_0012: ldc.i4.2 + IL_0013: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_0018: dup + IL_0019: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_001e: ldc.i4.3 + IL_001f: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::B + IL_0024: ret + } // end of method TestCases::Test4 + + .method public hidebysig static void ObjectInitializer() cil managed + { + // Code size 23 (0x17) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: dup + IL_000b: ldc.i4.0 + IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0034: ret - } // end of method TestCases::CollectionInitializerInsideObjectInitializers + IL_0016: ret + } // end of method TestCases::ObjectInitializer - .method public hidebysig static void NotAStructInitializer_DefaultConstructor() cil managed + .method public hidebysig static void NotAnObjectInitializer() cil managed { - // Code size 41 (0x29) + // Code size 25 (0x19) .maxstack 2 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) - IL_0000: ldloca.s V_0 - IL_0002: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0008: ldloca.s V_0 - IL_000a: ldc.i4.1 - IL_000b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0010: ldloca.s V_0 - IL_0012: ldc.i4.2 - IL_0013: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_0018: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_001d: ldloc.0 - IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.0 + IL_0008: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_000d: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0012: ldloc.0 + IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0028: ret - } // end of method TestCases::NotAStructInitializer_DefaultConstructor + IL_0018: ret + } // end of method TestCases::NotAnObjectInitializer - .method public hidebysig static void StructInitializer_DefaultConstructor() cil managed + .method public hidebysig static void NotAnObjectInitializerWithEvent() cil managed { - // Code size 41 (0x29) + // Code size 55 (0x37) .maxstack 3 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__51_0' + IL_000c: dup + IL_000d: brtrue.s IL_0026 + + IL_000f: pop + IL_0010: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9' + IL_0015: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'b__51_0'(object, + class [mscorlib]System.EventArgs) + IL_001b: newobj instance void [mscorlib]System.EventHandler::.ctor(object, + native int) + IL_0020: dup + IL_0021: stsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__51_0' + IL_0026: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) + IL_002b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0030: ldloc.0 + IL_0031: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0036: ret + } // end of method TestCases::NotAnObjectInitializerWithEvent + + .method public hidebysig static void ObjectInitializerAssignCollectionToField() cil managed + { + // Code size 48 (0x30) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: ldloca.s V_0 - IL_0007: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_000d: ldloca.s V_0 - IL_000f: ldc.i4.1 - IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0015: ldloca.s V_0 - IL_0017: ldc.i4.2 - IL_0018: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_001d: ldloc.0 - IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: dup + IL_000b: ldc.i4.0 + IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0011: dup + IL_0012: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0017: dup + IL_0018: ldc.i4.0 + IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001e: dup + IL_001f: ldc.i4.1 + IL_0020: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0025: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_002a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0028: ret - } // end of method TestCases::StructInitializer_DefaultConstructor + IL_002f: ret + } // end of method TestCases::ObjectInitializerAssignCollectionToField - .method public hidebysig static void NotAStructInitializer_ExplicitConstructor() cil managed + .method public hidebysig static void ObjectInitializerAddToCollectionInField() cil managed { - // Code size 41 (0x29) - .maxstack 2 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) - IL_0000: ldloca.s V_0 - IL_0002: ldc.i4.0 - IL_0003: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) - IL_0008: ldloca.s V_0 - IL_000a: ldc.i4.1 - IL_000b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0010: ldloca.s V_0 - IL_0012: ldc.i4.2 - IL_0013: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_0018: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_001d: ldloc.0 - IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + // Code size 47 (0x2f) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: dup + IL_000b: ldc.i4.0 + IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0011: dup + IL_0012: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0017: ldc.i4.0 + IL_0018: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001d: dup + IL_001e: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0023: ldc.i4.1 + IL_0024: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0029: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0028: ret - } // end of method TestCases::NotAStructInitializer_ExplicitConstructor + IL_002e: ret + } // end of method TestCases::ObjectInitializerAddToCollectionInField + + .method public hidebysig static void ObjectInitializerAssignCollectionToProperty() cil managed + { + // Code size 48 (0x30) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: dup + IL_000b: ldc.i4.0 + IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0011: dup + IL_0012: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0017: dup + IL_0018: ldc.i4.0 + IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001e: dup + IL_001f: ldc.i4.1 + IL_0020: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0025: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_PropertyList(class [mscorlib]System.Collections.Generic.List`1) + IL_002a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002f: ret + } // end of method TestCases::ObjectInitializerAssignCollectionToProperty + + .method public hidebysig static void ObjectInitializerAddToCollectionInProperty() cil managed + { + // Code size 47 (0x2f) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: dup + IL_000b: ldc.i4.0 + IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0011: dup + IL_0012: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() + IL_0017: ldc.i4.0 + IL_0018: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001d: dup + IL_001e: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() + IL_0023: ldc.i4.1 + IL_0024: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0029: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002e: ret + } // end of method TestCases::ObjectInitializerAddToCollectionInProperty + + .method public hidebysig static void ObjectInitializerWithInitializationOfNestedObjects() cil managed + { + // Code size 45 (0x2d) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: dup + IL_000b: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0010: ldc.i4.0 + IL_0011: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0016: dup + IL_0017: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_001c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0021: ldc.i4.1 + IL_0022: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0027: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002c: ret + } // end of method TestCases::ObjectInitializerWithInitializationOfNestedObjects + + .method public hidebysig static void ObjectInitializerWithInitializationOfDeeplyNestedObjects() cil managed + { + // Code size 77 (0x4d) + .maxstack 4 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: dup + IL_000b: ldc.i4.1 + IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0011: dup + IL_0012: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0017: ldc.i4.0 + IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_001d: dup + IL_001e: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0023: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0028: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_002d: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0032: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0037: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_003c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0041: ldc.i4.1 + IL_0042: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0047: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_004c: ret + } // end of method TestCases::ObjectInitializerWithInitializationOfDeeplyNestedObjects + + .method public hidebysig static void CollectionInitializerInsideObjectInitializers() cil managed + { + // Code size 53 (0x35) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: dup + IL_000b: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0010: dup + IL_0011: ldc.i4.0 + IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0017: dup + IL_0018: ldc.i4.1 + IL_0019: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_b(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_001e: dup + IL_001f: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() + IL_0024: ldc.i4.0 + IL_0025: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002a: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_MoreData(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) + IL_002f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0034: ret + } // end of method TestCases::CollectionInitializerInsideObjectInitializers + + .method public hidebysig static void NotAStructInitializer_DefaultConstructor() cil managed + { + // Code size 41 (0x29) + .maxstack 2 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: ldloca.s V_0 + IL_0002: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0008: ldloca.s V_0 + IL_000a: ldc.i4.1 + IL_000b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0010: ldloca.s V_0 + IL_0012: ldc.i4.2 + IL_0013: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_0018: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_001d: ldloc.0 + IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0028: ret + } // end of method TestCases::NotAStructInitializer_DefaultConstructor + + .method public hidebysig static void StructInitializer_DefaultConstructor() cil managed + { + // Code size 41 (0x29) + .maxstack 3 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldloca.s V_0 + IL_0007: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_000d: ldloca.s V_0 + IL_000f: ldc.i4.1 + IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0015: ldloca.s V_0 + IL_0017: ldc.i4.2 + IL_0018: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_001d: ldloc.0 + IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0028: ret + } // end of method TestCases::StructInitializer_DefaultConstructor + + .method public hidebysig static void NotAStructInitializer_ExplicitConstructor() cil managed + { + // Code size 41 (0x29) + .maxstack 2 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: ldloca.s V_0 + IL_0002: ldc.i4.0 + IL_0003: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) + IL_0008: ldloca.s V_0 + IL_000a: ldc.i4.1 + IL_000b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0010: ldloca.s V_0 + IL_0012: ldc.i4.2 + IL_0013: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_0018: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_001d: ldloc.0 + IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0028: ret + } // end of method TestCases::NotAStructInitializer_ExplicitConstructor + + .method public hidebysig static void StructInitializer_ExplicitConstructor() cil managed + { + // Code size 41 (0x29) + .maxstack 3 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldloca.s V_0 + IL_0007: ldc.i4.0 + IL_0008: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) + IL_000d: ldloca.s V_0 + IL_000f: ldc.i4.1 + IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0015: ldloca.s V_0 + IL_0017: ldc.i4.2 + IL_0018: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_001d: ldloc.0 + IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0028: ret + } // end of method TestCases::StructInitializer_ExplicitConstructor + + .method public hidebysig static void StructInitializerWithInitializationOfNestedObjects() cil managed + { + // Code size 74 (0x4a) + .maxstack 3 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: ldloca.s V_0 + IL_0007: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_000d: ldloca.s V_0 + IL_000f: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() + IL_0014: ldc.i4.0 + IL_0015: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_001a: ldloca.s V_0 + IL_001c: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() + IL_0021: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0026: ldc.i4.0 + IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002c: ldloca.s V_0 + IL_002e: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() + IL_0033: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0038: ldc.i4.1 + IL_0039: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_003e: ldloc.0 + IL_003f: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0044: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0049: ret + } // end of method TestCases::StructInitializerWithInitializationOfNestedObjects + + .method public hidebysig static void StructInitializerWithinObjectInitializer() cil managed + { + // Code size 47 (0x2f) + .maxstack 5 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: dup + IL_000b: ldloca.s V_0 + IL_000d: ldc.i4.2 + IL_000e: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) + IL_0013: ldloca.s V_0 + IL_0015: ldc.i4.1 + IL_0016: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_001b: ldloca.s V_0 + IL_001d: ldc.i4.2 + IL_001e: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_0023: ldloc.0 + IL_0024: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_NestedStruct(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData) + IL_0029: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002e: ret + } // end of method TestCases::StructInitializerWithinObjectInitializer + + .method public hidebysig static void Issue270_NestedInitialisers() cil managed + { + // Code size 115 (0x73) + .maxstack 8 + .locals init (class [mscorlib]System.Globalization.NumberFormatInfo[] V_0) + IL_0000: ldnull + IL_0001: stloc.0 + IL_0002: ldc.i4.0 + IL_0003: ldnull + IL_0004: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Issue270_NestedInitialisers() + IL_000a: newobj instance void [mscorlib]System.Threading.ThreadStart::.ctor(object, + native int) + IL_000f: newobj instance void [mscorlib]System.Threading.Thread::.ctor(class [mscorlib]System.Threading.ThreadStart) + IL_0014: dup + IL_0015: ldc.i4.1 + IL_0016: callvirt instance void [mscorlib]System.Threading.Thread::set_Priority(valuetype [mscorlib]System.Threading.ThreadPriority) + IL_001b: dup + IL_001c: ldc.i4.0 + IL_001d: newobj instance void [mscorlib]System.Globalization.CultureInfo::.ctor(int32) + IL_0022: dup + IL_0023: newobj instance void [mscorlib]System.Globalization.DateTimeFormatInfo::.ctor() + IL_0028: dup + IL_0029: ldstr "ddmmyy" + IL_002e: callvirt instance void [mscorlib]System.Globalization.DateTimeFormatInfo::set_ShortDatePattern(string) + IL_0033: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_DateTimeFormat(class [mscorlib]System.Globalization.DateTimeFormatInfo) + IL_0038: dup + IL_0039: ldloc.0 + IL_003a: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__65_0' + IL_003f: dup + IL_0040: brtrue.s IL_0059 + + IL_0042: pop + IL_0043: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9' + IL_0048: ldftn instance bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'b__65_0'(class [mscorlib]System.Globalization.NumberFormatInfo) + IL_004e: newobj instance void class [mscorlib]System.Func`2::.ctor(object, + native int) + IL_0053: dup + IL_0054: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__65_0' + IL_0059: call class [mscorlib]System.Collections.Generic.IEnumerable`1 [System.Core]System.Linq.Enumerable::Where(class [mscorlib]System.Collections.Generic.IEnumerable`1, + class [mscorlib]System.Func`2) + IL_005e: call !!0 [System.Core]System.Linq.Enumerable::First(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0063: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_NumberFormat(class [mscorlib]System.Globalization.NumberFormatInfo) + IL_0068: callvirt instance void [mscorlib]System.Threading.Thread::set_CurrentCulture(class [mscorlib]System.Globalization.CultureInfo) + IL_006d: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class [mscorlib]System.Threading.Thread) + IL_0072: ret + } // end of method TestCases::Issue270_NestedInitialisers + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 + Issue1345() cil managed + { + // Code size 28 (0x1c) + .maxstack 8 + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + IL_0005: dup + IL_0006: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::Data + IL_000b: ldc.i4.3 + IL_000c: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0011: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0016: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_001b: ret + } // end of method TestCases::Issue1345 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 + Issue1345b() cil managed + { + // Code size 28 (0x1c) + .maxstack 8 + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + IL_0005: dup + IL_0006: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data2() + IL_000b: ldc.i4.3 + IL_000c: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0011: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0016: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_001b: ret + } // end of method TestCases::Issue1345b + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 + Issue1345c() cil managed + { + // Code size 28 (0x1c) + .maxstack 8 + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + IL_0005: dup + IL_0006: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data3() + IL_000b: ldc.i4.3 + IL_000c: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0011: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0016: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_001b: ret + } // end of method TestCases::Issue1345c + + .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data + Issue1345_FalsePositive() cil managed + { + // Code size 30 (0x1e) + .maxstack 8 + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0005: dup + IL_0006: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_ReadOnlyPropertyList() + IL_000b: ldc.i4.0 + IL_000c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0011: dup + IL_0012: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_ReadOnlyPropertyList() + IL_0017: ldc.i4.1 + IL_0018: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001d: ret + } // end of method TestCases::Issue1345_FalsePositive + + .method private hidebysig instance void + Issue1250_Test1(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum 'value') cil managed + { + // Code size 23 (0x17) + .maxstack 8 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_000a: dup + IL_000b: ldarg.1 + IL_000c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0016: ret + } // end of method TestCases::Issue1250_Test1 + + .method private hidebysig instance void + Issue1251_Test(class [mscorlib]System.Collections.Generic.List`1 list, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem otherItem) cil managed + { + // Code size 151 (0x97) + .maxstack 4 + .locals init (valuetype [mscorlib]System.Nullable`1 V_0) + IL_0000: ldarg.1 + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::.ctor() + IL_0006: dup + IL_0007: ldstr "Text" + IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Text(string) + IL_0011: dup + IL_0012: ldarg.2 + IL_0013: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value() + IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value(valuetype [mscorlib]System.Decimal) + IL_001d: dup + IL_001e: ldarg.2 + IL_001f: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value2() + IL_0024: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value2(valuetype [mscorlib]System.Decimal) + IL_0029: dup + IL_002a: ldarg.2 + IL_002b: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable() + IL_0030: stloc.0 + IL_0031: ldloca.s V_0 + IL_0033: constrained. valuetype [mscorlib]System.Nullable`1 + IL_0039: callvirt instance string [mscorlib]System.Object::ToString() + IL_003e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value3(string) + IL_0043: dup + IL_0044: ldarg.2 + IL_0045: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable2() + IL_004a: stloc.0 + IL_004b: ldloca.s V_0 + IL_004d: constrained. valuetype [mscorlib]System.Nullable`1 + IL_0053: callvirt instance string [mscorlib]System.Object::ToString() + IL_0058: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value4(string) + IL_005d: dup + IL_005e: ldarg.2 + IL_005f: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable3() + IL_0064: stloc.0 + IL_0065: ldloca.s V_0 + IL_0067: constrained. valuetype [mscorlib]System.Nullable`1 + IL_006d: callvirt instance string [mscorlib]System.Object::ToString() + IL_0072: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value5(string) + IL_0077: dup + IL_0078: ldarg.2 + IL_0079: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable4() + IL_007e: stloc.0 + IL_007f: ldloca.s V_0 + IL_0081: constrained. valuetype [mscorlib]System.Nullable`1 + IL_0087: callvirt instance string [mscorlib]System.Object::ToString() + IL_008c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value6(string) + IL_0091: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0096: ret + } // end of method TestCases::Issue1251_Test + + .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data + Issue1279(int32 p) cil managed + { + // Code size 37 (0x25) + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldc.i4.1 + IL_0002: bne.un.s IL_0023 + + IL_0004: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0009: dup + IL_000a: ldc.i4.0 + IL_000b: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0010: dup + IL_0011: ldarg.0 + IL_0012: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Data_TestEvent(object, + class [mscorlib]System.EventArgs) + IL_0018: newobj instance void [mscorlib]System.EventHandler::.ctor(object, + native int) + IL_001d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) + IL_0022: ret + + IL_0023: ldnull + IL_0024: ret + } // end of method TestCases::Issue1279 + + .method public hidebysig static void ExtensionMethodInCollectionInitializer() cil managed + { + // Code size 38 (0x26) + .maxstack 6 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldc.i4.2 + IL_000d: newarr [mscorlib]System.Int32 + IL_0012: dup + IL_0013: ldc.i4.0 + IL_0014: ldc.i4.1 + IL_0015: stelem.i4 + IL_0016: dup + IL_0017: ldc.i4.1 + IL_0018: ldc.i4.2 + IL_0019: stelem.i4 + IL_001a: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) + IL_001f: ldloc.0 + IL_0020: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0025: ret + } // end of method TestCases::ExtensionMethodInCollectionInitializer + + .method public hidebysig static void NoCollectionInitializerBecauseOfTypeArguments() cil managed + { + // Code size 22 (0x16) + .maxstack 8 + IL_0000: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_0005: dup + IL_0006: ldstr "int" + IL_000b: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(string) + IL_0010: call void [mscorlib]System.Console::WriteLine(object) + IL_0015: ret + } // end of method TestCases::NoCollectionInitializerBecauseOfTypeArguments - .method public hidebysig static void StructInitializer_ExplicitConstructor() cil managed + .method public hidebysig static void CollectionInitializerWithParamsMethod() cil managed { - // Code size 41 (0x29) - .maxstack 3 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + // Code size 42 (0x2a) + .maxstack 5 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: ldloca.s V_0 - IL_0007: ldc.i4.0 - IL_0008: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) - IL_000d: ldloca.s V_0 - IL_000f: ldc.i4.1 - IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0015: ldloca.s V_0 - IL_0017: ldc.i4.2 - IL_0018: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_001d: ldloc.0 - IL_001e: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldc.i4.s 10 + IL_000e: newarr [mscorlib]System.Int32 + IL_0013: dup + IL_0014: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::E0D2592373A0C161E56E266306CD8405CD719D19 + IL_0019: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_001e: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) + IL_0023: ldloc.0 + IL_0024: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0028: ret - } // end of method TestCases::StructInitializer_ExplicitConstructor + IL_0029: ret + } // end of method TestCases::CollectionInitializerWithParamsMethod - .method public hidebysig static void StructInitializerWithInitializationOfNestedObjects() cil managed + .method public hidebysig static void CollectionInitializerList() cil managed { - // Code size 74 (0x4a) - .maxstack 3 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + // Code size 37 (0x25) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: ldloca.s V_0 - IL_0007: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_000d: ldloca.s V_0 - IL_000f: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() - IL_0014: ldc.i4.0 - IL_0015: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_001a: ldloca.s V_0 - IL_001c: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() - IL_0021: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0026: ldc.i4.0 - IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002c: ldloca.s V_0 - IL_002e: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() - IL_0033: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0038: ldc.i4.1 - IL_0039: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_003e: ldloc.0 - IL_003f: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0044: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000a: dup + IL_000b: ldc.i4.1 + IL_000c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0011: dup + IL_0012: ldc.i4.2 + IL_0013: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0018: dup + IL_0019: ldc.i4.3 + IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0049: ret - } // end of method TestCases::StructInitializerWithInitializationOfNestedObjects + IL_0024: ret + } // end of method TestCases::CollectionInitializerList - .method public hidebysig static void StructInitializerWithinObjectInitializer() cil managed + .method public hidebysig static object + RecursiveCollectionInitializer() cil managed { - // Code size 47 (0x2f) - .maxstack 5 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + // Code size 13 (0xd) + .maxstack 8 + IL_0000: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0005: dup + IL_0006: dup + IL_0007: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000c: ret + } // end of method TestCases::RecursiveCollectionInitializer + + .method public hidebysig static void CollectionInitializerDictionary() cil managed + { + // Code size 52 (0x34) + .maxstack 8 IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() IL_000a: dup - IL_000b: ldloca.s V_0 - IL_000d: ldc.i4.2 - IL_000e: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) - IL_0013: ldloca.s V_0 - IL_0015: ldc.i4.1 - IL_0016: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_001b: ldloca.s V_0 - IL_001d: ldc.i4.2 - IL_001e: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_0023: ldloc.0 - IL_0024: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_NestedStruct(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData) - IL_0029: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_000b: ldstr "First" + IL_0010: ldc.i4.1 + IL_0011: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0016: dup + IL_0017: ldstr "Second" + IL_001c: ldc.i4.2 + IL_001d: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0022: dup + IL_0023: ldstr "Third" + IL_0028: ldc.i4.3 + IL_0029: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_002e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002e: ret - } // end of method TestCases::StructInitializerWithinObjectInitializer + IL_0033: ret + } // end of method TestCases::CollectionInitializerDictionary - .method public hidebysig static void Bug270_NestedInitialisers() cil managed + .method public hidebysig static void CollectionInitializerDictionaryWithEnumTypes() cil managed { - // Code size 115 (0x73) + // Code size 32 (0x20) .maxstack 8 - .locals init (class [mscorlib]System.Globalization.NumberFormatInfo[] V_0) - IL_0000: ldnull - IL_0001: stloc.0 - IL_0002: ldc.i4.0 - IL_0003: ldnull - IL_0004: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Bug270_NestedInitialisers() - IL_000a: newobj instance void [mscorlib]System.Threading.ThreadStart::.ctor(object, - native int) - IL_000f: newobj instance void [mscorlib]System.Threading.Thread::.ctor(class [mscorlib]System.Threading.ThreadStart) - IL_0014: dup - IL_0015: ldc.i4.1 - IL_0016: callvirt instance void [mscorlib]System.Threading.Thread::set_Priority(valuetype [mscorlib]System.Threading.ThreadPriority) - IL_001b: dup - IL_001c: ldc.i4.0 - IL_001d: newobj instance void [mscorlib]System.Globalization.CultureInfo::.ctor(int32) - IL_0022: dup - IL_0023: newobj instance void [mscorlib]System.Globalization.DateTimeFormatInfo::.ctor() - IL_0028: dup - IL_0029: ldstr "ddmmyy" - IL_002e: callvirt instance void [mscorlib]System.Globalization.DateTimeFormatInfo::set_ShortDatePattern(string) - IL_0033: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_DateTimeFormat(class [mscorlib]System.Globalization.DateTimeFormatInfo) - IL_0038: dup - IL_0039: ldloc.0 - IL_003a: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__53_0' - IL_003f: dup - IL_0040: brtrue.s IL_0059 + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() + IL_000a: dup + IL_000b: ldc.i4.0 + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0012: dup + IL_0013: ldc.i4.1 + IL_0014: ldc.i4.1 + IL_0015: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_001a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001f: ret + } // end of method TestCases::CollectionInitializerDictionaryWithEnumTypes - IL_0042: pop - IL_0043: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9' - IL_0048: ldftn instance bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'b__53_0'(class [mscorlib]System.Globalization.NumberFormatInfo) - IL_004e: newobj instance void class [mscorlib]System.Func`2::.ctor(object, - native int) - IL_0053: dup - IL_0054: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__53_0' - IL_0059: call class [mscorlib]System.Collections.Generic.IEnumerable`1 [System.Core]System.Linq.Enumerable::Where(class [mscorlib]System.Collections.Generic.IEnumerable`1, - class [mscorlib]System.Func`2) - IL_005e: call !!0 [System.Core]System.Linq.Enumerable::First(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0063: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_NumberFormat(class [mscorlib]System.Globalization.NumberFormatInfo) - IL_0068: callvirt instance void [mscorlib]System.Threading.Thread::set_CurrentCulture(class [mscorlib]System.Globalization.CultureInfo) - IL_006d: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class [mscorlib]System.Threading.Thread) - IL_0072: ret - } // end of method TestCases::Bug270_NestedInitialisers + .method public hidebysig static void NotACollectionInitializer() cil managed + { + // Code size 39 (0x27) + .maxstack 2 + .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) + IL_0000: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.1 + IL_0008: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000d: ldloc.0 + IL_000e: ldc.i4.2 + IL_000f: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0014: ldloc.0 + IL_0015: ldc.i4.3 + IL_0016: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0020: ldloc.0 + IL_0021: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0026: ret + } // end of method TestCases::NotACollectionInitializer - .method public hidebysig static void Bug953_MissingNullableSpecifierForArrayInitializer() cil managed + .method public hidebysig static void SimpleDictInitializer() cil managed { - // Code size 29 (0x1d) + // Code size 41 (0x29) .maxstack 8 - IL_0000: ldc.i4.1 - IL_0001: newarr valuetype [mscorlib]System.Nullable`1 - IL_0006: dup - IL_0007: ldc.i4.0 - IL_0008: ldsfld valuetype [mscorlib]System.Guid [mscorlib]System.Guid::Empty - IL_000d: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0012: stelem valuetype [mscorlib]System.Nullable`1 - IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::NoOp(valuetype [mscorlib]System.Nullable`1[]) - IL_001c: ret - } // end of method TestCases::Bug953_MissingNullableSpecifierForArrayInitializer + IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000a: dup + IL_000b: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0010: ldc.i4.0 + IL_0011: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0016: dup + IL_0017: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_001c: ldc.i4.2 + IL_001d: ldnull + IL_001e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0028: ret + } // end of method TestCases::SimpleDictInitializer - .method private hidebysig instance void - Issue907_Test3(string text) cil managed + .method public hidebysig static void MixedObjectAndDictInitializer() cil managed { - // Code size 28 (0x1c) - .maxstack 8 + // Code size 130 (0x82) + .maxstack 6 + .locals init (int32 V_0, + int32 V_1, + string V_2) IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() + IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() IL_000a: dup - IL_000b: ldstr "" - IL_0010: ldarg.1 - IL_0011: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_000b: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0010: ldc.i4.0 + IL_0011: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0016: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetInt() + IL_001b: stloc.0 + IL_001c: dup + IL_001d: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0022: ldloc.0 + IL_0023: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) + IL_0028: ldc.i4.1 + IL_0029: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_002e: dup + IL_002f: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0034: ldloc.0 + IL_0035: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) + IL_003a: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_003f: ldc.i4.0 + IL_0040: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0045: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetInt() + IL_004a: stloc.1 + IL_004b: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetString() + IL_0050: stloc.2 + IL_0051: dup + IL_0052: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0057: ldloc.0 + IL_0058: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) + IL_005d: ldloc.1 + IL_005e: ldloc.2 + IL_005f: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0064: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, + string, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) + IL_0069: dup + IL_006a: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_006f: ldloc.0 + IL_0070: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) + IL_0075: ldc.i4.2 + IL_0076: ldnull + IL_0077: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) + IL_007c: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_001b: ret - } // end of method TestCases::Issue907_Test3 + IL_0081: ret + } // end of method TestCases::MixedObjectAndDictInitializer .method private hidebysig instance void - Issue1250_Test1(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum 'value') cil managed + NestedListWithIndexInitializer(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum myEnum) cil managed { - // Code size 23 (0x17) + // Code size 59 (0x3b) .maxstack 8 - IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0005: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_000a: dup - IL_000b: ldarg.1 - IL_000c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_0011: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0016: ret - } // end of method TestCases::Issue1250_Test1 + IL_0000: newobj instance void class [mscorlib]System.Collections.Generic.List`1>::.ctor() + IL_0005: dup + IL_0006: ldc.i4.0 + IL_0007: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) + IL_000c: ldc.i4.1 + IL_000d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0012: dup + IL_0013: ldc.i4.0 + IL_0014: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) + IL_0019: ldc.i4.2 + IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001f: dup + IL_0020: ldc.i4.0 + IL_0021: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) + IL_0026: ldc.i4.3 + IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002c: dup + IL_002d: ldc.i4.1 + IL_002e: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) + IL_0033: ldarg.1 + IL_0034: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0039: pop + IL_003a: ret + } // end of method TestCases::NestedListWithIndexInitializer .method private hidebysig instance void Issue1250_Test2(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum 'value') cil managed @@ -2222,160 +2957,6 @@ IL_0023: ret } // end of method TestCases::Issue1250_Test4 - .method private hidebysig instance void - Issue1251_Test(class [mscorlib]System.Collections.Generic.List`1 list, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem otherItem) cil managed - { - // Code size 151 (0x97) - .maxstack 4 - .locals init (valuetype [mscorlib]System.Nullable`1 V_0) - IL_0000: ldarg.1 - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::.ctor() - IL_0006: dup - IL_0007: ldstr "Text" - IL_000c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Text(string) - IL_0011: dup - IL_0012: ldarg.2 - IL_0013: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value() - IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value(valuetype [mscorlib]System.Decimal) - IL_001d: dup - IL_001e: ldarg.2 - IL_001f: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value2() - IL_0024: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value2(valuetype [mscorlib]System.Decimal) - IL_0029: dup - IL_002a: ldarg.2 - IL_002b: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable() - IL_0030: stloc.0 - IL_0031: ldloca.s V_0 - IL_0033: constrained. valuetype [mscorlib]System.Nullable`1 - IL_0039: callvirt instance string [mscorlib]System.Object::ToString() - IL_003e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value3(string) - IL_0043: dup - IL_0044: ldarg.2 - IL_0045: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable2() - IL_004a: stloc.0 - IL_004b: ldloca.s V_0 - IL_004d: constrained. valuetype [mscorlib]System.Nullable`1 - IL_0053: callvirt instance string [mscorlib]System.Object::ToString() - IL_0058: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value4(string) - IL_005d: dup - IL_005e: ldarg.2 - IL_005f: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable3() - IL_0064: stloc.0 - IL_0065: ldloca.s V_0 - IL_0067: constrained. valuetype [mscorlib]System.Nullable`1 - IL_006d: callvirt instance string [mscorlib]System.Object::ToString() - IL_0072: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value5(string) - IL_0077: dup - IL_0078: ldarg.2 - IL_0079: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable4() - IL_007e: stloc.0 - IL_007f: ldloca.s V_0 - IL_0081: constrained. valuetype [mscorlib]System.Nullable`1 - IL_0087: callvirt instance string [mscorlib]System.Object::ToString() - IL_008c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value6(string) - IL_0091: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0096: ret - } // end of method TestCases::Issue1251_Test - - .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data - Issue1279(int32 p) cil managed - { - // Code size 37 (0x25) - .maxstack 8 - IL_0000: ldarg.1 - IL_0001: ldc.i4.1 - IL_0002: bne.un.s IL_0023 - - IL_0004: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0009: dup - IL_000a: ldc.i4.0 - IL_000b: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0010: dup - IL_0011: ldarg.0 - IL_0012: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Data_TestEvent(object, - class [mscorlib]System.EventArgs) - IL_0018: newobj instance void [mscorlib]System.EventHandler::.ctor(object, - native int) - IL_001d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) - IL_0022: ret - - IL_0023: ldnull - IL_0024: ret - } // end of method TestCases::Issue1279 - - .method private hidebysig instance void - Data_TestEvent(object sender, - class [mscorlib]System.EventArgs e) cil managed - { - // Code size 6 (0x6) - .maxstack 8 - IL_0000: newobj instance void [mscorlib]System.NotImplementedException::.ctor() - IL_0005: throw - } // end of method TestCases::Data_TestEvent - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 - Issue1345() cil managed - { - // Code size 28 (0x1c) - .maxstack 8 - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() - IL_0005: dup - IL_0006: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::Data - IL_000b: ldc.i4.3 - IL_000c: newobj instance void [mscorlib]System.Decimal::.ctor(int32) - IL_0011: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0016: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) - IL_001b: ret - } // end of method TestCases::Issue1345 - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 - Issue1345b() cil managed - { - // Code size 28 (0x1c) - .maxstack 8 - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() - IL_0005: dup - IL_0006: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data2() - IL_000b: ldc.i4.3 - IL_000c: newobj instance void [mscorlib]System.Decimal::.ctor(int32) - IL_0011: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0016: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) - IL_001b: ret - } // end of method TestCases::Issue1345b - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 - Issue1345c() cil managed - { - // Code size 28 (0x1c) - .maxstack 8 - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() - IL_0005: dup - IL_0006: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data3() - IL_000b: ldc.i4.3 - IL_000c: newobj instance void [mscorlib]System.Decimal::.ctor(int32) - IL_0011: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0016: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) - IL_001b: ret - } // end of method TestCases::Issue1345c - - .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data - Issue1345_FalsePositive() cil managed - { - // Code size 30 (0x1e) - .maxstack 8 - IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0005: dup - IL_0006: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_ReadOnlyPropertyList() - IL_000b: ldc.i4.0 - IL_000c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0011: dup - IL_0012: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_ReadOnlyPropertyList() - IL_0017: ldc.i4.1 - IL_0018: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001d: ret - } // end of method TestCases::Issue1345_FalsePositive - .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { @@ -2392,6 +2973,27 @@ extends [mscorlib]System.Object { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=10' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 10 + } // end of class '__StaticArrayInitTypeSize=10' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=12' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 12 + } // end of class '__StaticArrayInitTypeSize=12' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=24' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 24 + } // end of class '__StaticArrayInitTypeSize=24' + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=40' extends [mscorlib]System.ValueType { @@ -2399,14 +3001,81 @@ .size 40 } // end of class '__StaticArrayInitTypeSize=40' - .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=40' E0D2592373A0C161E56E266306CD8405CD719D19 at I_00005418 + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=48' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 48 + } // end of class '__StaticArrayInitTypeSize=48' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=80' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 80 + } // end of class '__StaticArrayInitTypeSize=80' + + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=10' '20E3FF489634E18F3F7EB292AD504DBAE9519293' at I_00005EF8 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=10' '56D9EEC8EF899644C40B9BE9D886DF2367A5D078' at I_00005F08 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=12' '735E5A21849E86F68D220F06163E8C5C6376B9C9' at I_00005F18 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=40' '8D903ECAD8D9D75B3183B23AF79F6D2E607369E3' at I_00005F28 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=80' '9B1F6E56D755443CC39C1969CE38FD41FD4EF4B7' at I_00005F50 + .field static assembly initonly int64 A6296CAC471BE2954899600137940479D8073C7C at I_00005FA0 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=40' B9583930B842DBCEF0D7B8E57D4D3F1E8055C39E at I_00005FA8 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=24' C4E70AB31EF6C8908F896CAD1C6BC75F7FA65E27 at I_00005FD0 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=48' DC7043B0114737ACE19A23DD755893795FD48A23 at I_00005FE8 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=40' E0D2592373A0C161E56E266306CD8405CD719D19 at I_00006018 + .field static assembly initonly int64 EB0715DBB235F3F696F2C404F5839C6650640898 at I_00006040 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=40' F514FF55B79BCAA2CEC9B56C062D976E45F89AB7 at I_00006048 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=24' FBCB49C1A244C1B5781AA1DB02C5A11F68908526 at I_00006070 } // end of class '' // ============================================================= -.data cil I_00005418 = bytearray ( +.data cil I_00005EF8 = bytearray ( + 01 02 03 04 05 06 07 08 FE FF) +.data cil I_00005F02 = int8[6] +.data cil I_00005F08 = bytearray ( + 00 80 FF FF 00 00 01 00 FF 7F) +.data cil I_00005F12 = int8[6] +.data cil I_00005F18 = bytearray ( + 00 00 01 00 FF 7F 00 80 FE FF FF FF) +.data cil I_00005F24 = int8[4] +.data cil I_00005F28 = bytearray ( + 01 00 0C BB 7D 6E 9C BA FF FF FF FF FF FF FF FF // ....}n.......... + 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 + FF FF F3 44 82 91 63 45) // ...D..cE +.data cil I_00005F50 = bytearray ( + 01 00 00 00 00 00 00 00 00 94 35 77 00 00 00 00 // ..........5w.... + 00 5E D0 B2 00 00 00 00 04 00 00 00 00 00 00 00 // .^.............. + 05 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 + 07 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 + FF FF F3 44 82 91 63 45 FF FF E7 89 04 23 C7 8A) // ...D..cE.....#.. +.data cil I_00005FA0 = bytearray ( + 80 81 00 01 02 03 04 7F) +.data cil I_00005FA8 = bytearray ( + 01 00 00 00 00 94 35 77 00 5E D0 B2 04 00 00 00 // ......5w.^...... + 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_00005FD0 = bytearray ( + 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 + 05 00 00 00 06 00 00 00) +.data cil I_00005FE8 = bytearray ( + 00 00 00 00 00 00 F8 BF 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 F8 3F 00 00 00 00 00 00 F0 FF // .......?........ + 00 00 00 00 00 00 F0 7F 00 00 00 00 00 00 F8 FF) +.data cil I_00006018 = bytearray ( 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00) +.data cil I_00006040 = bytearray ( + 01 00 01 00 00 00 01 01) +.data cil I_00006048 = bytearray ( + 01 00 00 00 FE FF FF FF 00 94 35 77 04 00 00 00 // ..........5w.... + 05 00 00 00 FA FF FF FF 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_00006070 = bytearray ( + 00 00 C0 BF 00 00 00 00 00 00 C0 3F 00 00 80 FF // ...........?.... + 00 00 80 7F 00 00 C0 FF) // *********** DISASSEMBLY COMPLETE *********************** diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.roslyn.il index 03e666539..0af7b7eee 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.roslyn.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.roslyn.il @@ -1226,8 +1226,8 @@ { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .field public static initonly class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c' '<>9' - .field public static class [mscorlib]System.EventHandler '<>9__33_0' - .field public static class [mscorlib]System.Func`2 '<>9__53_0' + .field public static class [mscorlib]System.EventHandler '<>9__51_0' + .field public static class [mscorlib]System.Func`2 '<>9__65_0' .method private hidebysig specialname rtspecialname static void .cctor() cil managed { @@ -1250,7 +1250,7 @@ } // end of method '<>c'::.ctor .method assembly hidebysig instance void - 'b__33_0'(object '', + 'b__51_0'(object '', class [mscorlib]System.EventArgs '') cil managed { // Code size 8 (0x8) @@ -1259,10 +1259,10 @@ IL_0001: call void [mscorlib]System.Console::WriteLine() IL_0006: nop IL_0007: ret - } // end of method '<>c'::'b__33_0' + } // end of method '<>c'::'b__51_0' .method assembly hidebysig instance bool - 'b__53_0'(class [mscorlib]System.Globalization.NumberFormatInfo format) cil managed + 'b__65_0'(class [mscorlib]System.Globalization.NumberFormatInfo format) cil managed { // Code size 17 (0x11) .maxstack 8 @@ -1272,7 +1272,7 @@ IL_000b: call bool [mscorlib]System.String::op_Equality(string, string) IL_0010: ret - } // end of method '<>c'::'b__53_0' + } // end of method '<>c'::'b__65_0' } // end of class '<>c' @@ -1325,1129 +1325,1968 @@ IL_0006: ret } // end of method TestCases::TestCall - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test1() cil managed - { - // Code size 42 (0x2a) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) - IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000d: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_0012: ldloc.0 - IL_0013: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_0018: ldc.i4.1 - IL_0019: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_001e: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0023: nop - IL_0024: ldloc.0 - IL_0025: stloc.1 - IL_0026: br.s IL_0028 - - IL_0028: ldloc.1 - IL_0029: ret - } // end of method TestCases::Test1 - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test1Alternative() cil managed + .method private hidebysig static int32 + GetInt() cil managed { - // Code size 41 (0x29) - .maxstack 6 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + // Code size 7 (0x7) + .maxstack 1 + .locals init (int32 V_0) IL_0000: nop IL_0001: ldc.i4.1 - IL_0002: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0007: dup - IL_0008: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000d: dup - IL_000e: ldc.i4.1 - IL_000f: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_0014: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0019: nop - IL_001a: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L - IL_001f: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) - IL_0024: stloc.0 - IL_0025: br.s IL_0027 + IL_0002: stloc.0 + IL_0003: br.s IL_0005 - IL_0027: ldloc.0 - IL_0028: ret - } // end of method TestCases::Test1Alternative + IL_0005: ldloc.0 + IL_0006: ret + } // end of method TestCases::GetInt - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test2() cil managed + .method private hidebysig static string + GetString() cil managed { - // Code size 27 (0x1b) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + // Code size 11 (0xb) + .maxstack 1 + .locals init (string V_0) IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0001: ldstr "Test" IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.1 - IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_000e: ldloc.0 - IL_000f: ldc.i4.2 - IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_0015: ldloc.0 - IL_0016: stloc.1 - IL_0017: br.s IL_0019 + IL_0007: br.s IL_0009 - IL_0019: ldloc.1 - IL_001a: ret - } // end of method TestCases::Test2 + IL_0009: ldloc.0 + IL_000a: ret + } // end of method TestCases::GetString - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test3() cil managed + .method private hidebysig static void NoOp(valuetype [mscorlib]System.Nullable`1[] 'array') cil managed { - // Code size 37 (0x25) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + // Code size 2 (0x2) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.1 - IL_0009: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) - IL_000e: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0013: ldloc.0 - IL_0014: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0019: ldc.i4.2 - IL_001a: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_001f: ldloc.0 - IL_0020: stloc.1 - IL_0021: br.s IL_0023 - - IL_0023: ldloc.1 - IL_0024: ret - } // end of method TestCases::Test3 + IL_0001: ret + } // end of method TestCases::NoOp - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test3b() cil managed + .method private hidebysig instance void + Data_TestEvent(object sender, + class [mscorlib]System.EventArgs e) cil managed { - // Code size 36 (0x24) - .maxstack 4 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + // Code size 7 (0x7) + .maxstack 8 IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0007: dup - IL_0008: ldc.i4.1 - IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_000e: dup - IL_000f: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0014: ldc.i4.2 - IL_0015: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_001a: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) - IL_001f: stloc.0 - IL_0020: br.s IL_0022 - - IL_0022: ldloc.0 - IL_0023: ret - } // end of method TestCases::Test3b + IL_0001: newobj instance void [mscorlib]System.NotImplementedException::.ctor() + IL_0006: throw + } // end of method TestCases::Data_TestEvent - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C - Test4() cil managed + .method public hidebysig static void Array1() cil managed { - // Code size 44 (0x2c) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + // Code size 31 (0x1f) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_000d: ldc.i4.1 - IL_000e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A - IL_0013: ldloc.0 - IL_0014: ldc.i4.2 - IL_0015: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_001a: ldloc.0 - IL_001b: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y - IL_0020: ldc.i4.3 - IL_0021: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::B - IL_0026: ldloc.0 - IL_0027: stloc.1 - IL_0028: br.s IL_002a + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.s 10 + IL_0008: newarr [mscorlib]System.Int32 + IL_000d: dup + IL_000e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::E0D2592373A0C161E56E266306CD8405CD719D19 + IL_0013: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001d: nop + IL_001e: ret + } // end of method TestCases::Array1 - IL_002a: ldloc.1 - IL_002b: ret - } // end of method TestCases::Test4 + .method public hidebysig static void Array2(int32 a, + int32 b, + int32 c) cil managed + { + // Code size 31 (0x1f) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.5 + IL_0007: newarr [mscorlib]System.Int32 + IL_000c: dup + IL_000d: ldc.i4.0 + IL_000e: ldarg.0 + IL_000f: stelem.i4 + IL_0010: dup + IL_0011: ldc.i4.2 + IL_0012: ldarg.1 + IL_0013: stelem.i4 + IL_0014: dup + IL_0015: ldc.i4.4 + IL_0016: ldarg.2 + IL_0017: stelem.i4 + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001d: nop + IL_001e: ret + } // end of method TestCases::Array2 - .method public hidebysig static void InvalidIndices(int32 a) cil managed + .method public hidebysig static void NestedArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 25 (0x19) - .maxstack 3 - .locals init (int32[] V_0) + // Code size 81 (0x51) + .maxstack 8 IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: newarr [mscorlib]System.Int32 - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldc.i4.1 - IL_000a: ldarg.0 - IL_000b: stelem.i4 - IL_000c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0011: ldloc.0 - IL_0012: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.3 + IL_0007: newarr int32[] + IL_000c: dup + IL_000d: ldc.i4.0 + IL_000e: ldc.i4.s 10 + IL_0010: newarr [mscorlib]System.Int32 + IL_0015: dup + IL_0016: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::E0D2592373A0C161E56E266306CD8405CD719D19 + IL_001b: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0020: stelem.ref + IL_0021: dup + IL_0022: ldc.i4.1 + IL_0023: ldc.i4.3 + IL_0024: newarr [mscorlib]System.Int32 + IL_0029: dup + IL_002a: ldc.i4.0 + IL_002b: ldarg.0 + IL_002c: stelem.i4 + IL_002d: dup + IL_002e: ldc.i4.1 + IL_002f: ldarg.1 + IL_0030: stelem.i4 + IL_0031: dup + IL_0032: ldc.i4.2 + IL_0033: ldarg.2 + IL_0034: stelem.i4 + IL_0035: stelem.ref + IL_0036: dup + IL_0037: ldc.i4.2 + IL_0038: ldc.i4.6 + IL_0039: newarr [mscorlib]System.Int32 + IL_003e: dup + IL_003f: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=24' ''::C4E70AB31EF6C8908F896CAD1C6BC75F7FA65E27 + IL_0044: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0049: stelem.ref + IL_004a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0017: nop - IL_0018: ret - } // end of method TestCases::InvalidIndices + IL_004f: nop + IL_0050: ret + } // end of method TestCases::NestedArray - .method public hidebysig static void InvalidIndices2(int32 a) cil managed + .method public hidebysig static void NestedNullableArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 25 (0x19) - .maxstack 3 - .locals init (int32[] V_0) + // Code size 297 (0x129) + .maxstack 8 IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: newarr [mscorlib]System.Int32 - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldc.i4.m1 - IL_000a: ldarg.0 - IL_000b: stelem.i4 - IL_000c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0011: ldloc.0 - IL_0012: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.3 + IL_0007: newarr valuetype [mscorlib]System.Nullable`1[] + IL_000c: dup + IL_000d: ldc.i4.0 + IL_000e: ldc.i4.s 11 + IL_0010: newarr valuetype [mscorlib]System.Nullable`1 + IL_0015: dup + IL_0016: ldc.i4.0 + IL_0017: ldc.i4.1 + IL_0018: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_001d: stelem valuetype [mscorlib]System.Nullable`1 + IL_0022: dup + IL_0023: ldc.i4.1 + IL_0024: ldc.i4.2 + IL_0025: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_002a: stelem valuetype [mscorlib]System.Nullable`1 + IL_002f: dup + IL_0030: ldc.i4.2 + IL_0031: ldc.i4.3 + IL_0032: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0037: stelem valuetype [mscorlib]System.Nullable`1 + IL_003c: dup + IL_003d: ldc.i4.3 + IL_003e: ldc.i4.4 + IL_003f: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0044: stelem valuetype [mscorlib]System.Nullable`1 + IL_0049: dup + IL_004a: ldc.i4.4 + IL_004b: ldc.i4.5 + IL_004c: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0051: stelem valuetype [mscorlib]System.Nullable`1 + IL_0056: dup + IL_0057: ldc.i4.5 + IL_0058: ldc.i4.6 + IL_0059: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_005e: stelem valuetype [mscorlib]System.Nullable`1 + IL_0063: dup + IL_0064: ldc.i4.6 + IL_0065: ldc.i4.7 + IL_0066: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_006b: stelem valuetype [mscorlib]System.Nullable`1 + IL_0070: dup + IL_0071: ldc.i4.7 + IL_0072: ldc.i4.8 + IL_0073: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0078: stelem valuetype [mscorlib]System.Nullable`1 + IL_007d: dup + IL_007e: ldc.i4.8 + IL_007f: ldc.i4.s 9 + IL_0081: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0086: stelem valuetype [mscorlib]System.Nullable`1 + IL_008b: dup + IL_008c: ldc.i4.s 9 + IL_008e: ldc.i4.s 10 + IL_0090: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0095: stelem valuetype [mscorlib]System.Nullable`1 + IL_009a: stelem.ref + IL_009b: dup + IL_009c: ldc.i4.1 + IL_009d: ldc.i4.4 + IL_009e: newarr valuetype [mscorlib]System.Nullable`1 + IL_00a3: dup + IL_00a4: ldc.i4.0 + IL_00a5: ldarg.0 + IL_00a6: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00ab: stelem valuetype [mscorlib]System.Nullable`1 + IL_00b0: dup + IL_00b1: ldc.i4.1 + IL_00b2: ldarg.1 + IL_00b3: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00b8: stelem valuetype [mscorlib]System.Nullable`1 + IL_00bd: dup + IL_00be: ldc.i4.2 + IL_00bf: ldarg.2 + IL_00c0: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00c5: stelem valuetype [mscorlib]System.Nullable`1 + IL_00ca: stelem.ref + IL_00cb: dup + IL_00cc: ldc.i4.2 + IL_00cd: ldc.i4.7 + IL_00ce: newarr valuetype [mscorlib]System.Nullable`1 + IL_00d3: dup + IL_00d4: ldc.i4.0 + IL_00d5: ldc.i4.1 + IL_00d6: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00db: stelem valuetype [mscorlib]System.Nullable`1 + IL_00e0: dup + IL_00e1: ldc.i4.1 + IL_00e2: ldc.i4.2 + IL_00e3: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00e8: stelem valuetype [mscorlib]System.Nullable`1 + IL_00ed: dup + IL_00ee: ldc.i4.2 + IL_00ef: ldc.i4.3 + IL_00f0: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_00f5: stelem valuetype [mscorlib]System.Nullable`1 + IL_00fa: dup + IL_00fb: ldc.i4.3 + IL_00fc: ldc.i4.4 + IL_00fd: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0102: stelem valuetype [mscorlib]System.Nullable`1 + IL_0107: dup + IL_0108: ldc.i4.4 + IL_0109: ldc.i4.5 + IL_010a: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_010f: stelem valuetype [mscorlib]System.Nullable`1 + IL_0114: dup + IL_0115: ldc.i4.5 + IL_0116: ldc.i4.6 + IL_0117: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_011c: stelem valuetype [mscorlib]System.Nullable`1 + IL_0121: stelem.ref + IL_0122: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0017: nop - IL_0018: ret - } // end of method TestCases::InvalidIndices2 + IL_0127: nop + IL_0128: ret + } // end of method TestCases::NestedNullableArray - .method public hidebysig static void IndicesInWrongOrder(int32 a, - int32 b) cil managed + .method public hidebysig static void NestedPointerArray(int32 a, + int32 b, + int32 c) cil managed { - // Code size 29 (0x1d) - .maxstack 3 - .locals init (int32[] V_0) + // Code size 76 (0x4c) + .maxstack 8 IL_0000: nop - IL_0001: ldc.i4.5 - IL_0002: newarr [mscorlib]System.Int32 - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldc.i4.2 - IL_000a: ldarg.1 - IL_000b: stelem.i4 - IL_000c: ldloc.0 - IL_000d: ldc.i4.1 - IL_000e: ldarg.0 - IL_000f: stelem.i4 - IL_0010: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0015: ldloc.0 - IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.3 + IL_0007: newarr void*[] + IL_000c: dup + IL_000d: ldc.i4.0 + IL_000e: ldc.i4.1 + IL_000f: newarr void* + IL_0014: dup + IL_0015: ldc.i4.0 + IL_0016: ldc.i4.0 + IL_0017: conv.u + IL_0018: stelem.i + IL_0019: stelem.ref + IL_001a: dup + IL_001b: ldc.i4.1 + IL_001c: ldc.i4.2 + IL_001d: newarr void* + IL_0022: dup + IL_0023: ldc.i4.0 + IL_0024: ldc.i4 0xc8 + IL_0029: conv.i + IL_002a: stelem.i + IL_002b: dup + IL_002c: ldc.i4.1 + IL_002d: ldc.i4.0 + IL_002e: conv.u + IL_002f: stelem.i + IL_0030: stelem.ref + IL_0031: dup + IL_0032: ldc.i4.2 + IL_0033: ldc.i4.2 + IL_0034: newarr void* + IL_0039: dup + IL_003a: ldc.i4.0 + IL_003b: ldc.i4.s 100 + IL_003d: conv.i + IL_003e: stelem.i + IL_003f: dup + IL_0040: ldc.i4.1 + IL_0041: ldc.i4.0 + IL_0042: conv.u + IL_0043: stelem.i + IL_0044: stelem.ref + IL_0045: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_001b: nop - IL_001c: ret - } // end of method TestCases::IndicesInWrongOrder + IL_004a: nop + IL_004b: ret + } // end of method TestCases::NestedPointerArray - .method public hidebysig static void ExtensionMethodInCollectionInitializer() cil managed + .method public hidebysig static void ArrayBoolean() cil managed { - // Code size 41 (0x29) - .maxstack 6 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) + // Code size 30 (0x1e) + .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_000b: stloc.0 - IL_000c: ldloc.0 - IL_000d: ldc.i4.2 - IL_000e: newarr [mscorlib]System.Int32 - IL_0013: dup - IL_0014: ldc.i4.0 - IL_0015: ldc.i4.1 - IL_0016: stelem.i4 - IL_0017: dup - IL_0018: ldc.i4.1 - IL_0019: ldc.i4.2 - IL_001a: stelem.i4 - IL_001b: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) - IL_0020: nop - IL_0021: ldloc.0 - IL_0022: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: ldc.i4.8 + IL_0007: newarr [mscorlib]System.Boolean + IL_000c: dup + IL_000d: ldtoken field int64 ''::EB0715DBB235F3F696F2C404F5839C6650640898 + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0027: nop - IL_0028: ret - } // end of method TestCases::ExtensionMethodInCollectionInitializer + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayBoolean - .method public hidebysig static void NoCollectionInitializerBecauseOfTypeArguments() cil managed + .method public hidebysig static void ArrayByte() cil managed { - // Code size 27 (0x1b) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) + // Code size 31 (0x1f) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldstr "int" - IL_000d: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(string) - IL_0012: nop - IL_0013: ldloc.0 - IL_0014: call void [mscorlib]System.Console::WriteLine(object) - IL_0019: nop - IL_001a: ret - } // end of method TestCases::NoCollectionInitializerBecauseOfTypeArguments + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.s 10 + IL_0008: newarr [mscorlib]System.Byte + IL_000d: dup + IL_000e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=10' ''::'20E3FF489634E18F3F7EB292AD504DBAE9519293' + IL_0013: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001d: nop + IL_001e: ret + } // end of method TestCases::ArrayByte - .method public hidebysig static void CollectionInitializerWithParamsMethod() cil managed + .method public hidebysig static void ArraySByte() cil managed { - // Code size 45 (0x2d) - .maxstack 5 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) + // Code size 30 (0x1e) + .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() - IL_000b: stloc.0 - IL_000c: ldloc.0 - IL_000d: ldc.i4.s 10 - IL_000f: newarr [mscorlib]System.Int32 - IL_0014: dup - IL_0015: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::E0D2592373A0C161E56E266306CD8405CD719D19 - IL_001a: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + IL_0006: ldc.i4.8 + IL_0007: newarr [mscorlib]System.SByte + IL_000c: dup + IL_000d: ldtoken field int64 ''::A6296CAC471BE2954899600137940479D8073C7C + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, valuetype [mscorlib]System.RuntimeFieldHandle) - IL_001f: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) - IL_0024: nop - IL_0025: ldloc.0 - IL_0026: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002b: nop - IL_002c: ret - } // end of method TestCases::CollectionInitializerWithParamsMethod + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArraySByte - .method public hidebysig static void CollectionInitializerList() cil managed + .method public hidebysig static void ArrayShort() cil managed { - // Code size 42 (0x2a) + // Code size 30 (0x1e) .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_000b: dup - IL_000c: ldc.i4.1 - IL_000d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0012: nop - IL_0013: dup - IL_0014: ldc.i4.2 - IL_0015: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001a: nop - IL_001b: dup - IL_001c: ldc.i4.3 - IL_001d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0022: nop - IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: ldc.i4.5 + IL_0007: newarr [mscorlib]System.Int16 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=10' ''::'56D9EEC8EF899644C40B9BE9D886DF2367A5D078' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0028: nop - IL_0029: ret - } // end of method TestCases::CollectionInitializerList + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayShort - .method public hidebysig static object - RecursiveCollectionInitializer() cil managed + .method public hidebysig static void ArrayUShort() cil managed { - // Code size 21 (0x15) - .maxstack 2 - .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0, - object V_1) + // Code size 30 (0x1e) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldloc.0 - IL_0009: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_000e: nop - IL_000f: ldloc.0 - IL_0010: stloc.1 - IL_0011: br.s IL_0013 + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.6 + IL_0007: newarr [mscorlib]System.UInt16 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=12' ''::'735E5A21849E86F68D220F06163E8C5C6376B9C9' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayUShort - IL_0013: ldloc.1 - IL_0014: ret - } // end of method TestCases::RecursiveCollectionInitializer + .method public hidebysig static void ArrayInt() cil managed + { + // Code size 31 (0x1f) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.s 10 + IL_0008: newarr [mscorlib]System.Int32 + IL_000d: dup + IL_000e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::F514FF55B79BCAA2CEC9B56C062D976E45F89AB7 + IL_0013: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001d: nop + IL_001e: ret + } // end of method TestCases::ArrayInt - .method public hidebysig static void CollectionInitializerDictionary() cil managed + .method public hidebysig static void ArrayUInt() cil managed { - // Code size 57 (0x39) + // Code size 31 (0x1f) .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() - IL_000b: dup - IL_000c: ldstr "First" - IL_0011: ldc.i4.1 - IL_0012: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0017: nop - IL_0018: dup - IL_0019: ldstr "Second" - IL_001e: ldc.i4.2 - IL_001f: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0024: nop - IL_0025: dup - IL_0026: ldstr "Third" - IL_002b: ldc.i4.3 - IL_002c: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0031: nop - IL_0032: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: ldc.i4.s 10 + IL_0008: newarr [mscorlib]System.UInt32 + IL_000d: dup + IL_000e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::B9583930B842DBCEF0D7B8E57D4D3F1E8055C39E + IL_0013: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0037: nop - IL_0038: ret - } // end of method TestCases::CollectionInitializerDictionary + IL_001d: nop + IL_001e: ret + } // end of method TestCases::ArrayUInt - .method public hidebysig static void CollectionInitializerDictionaryWithEnumTypes() cil managed + .method public hidebysig static void ArrayLong() cil managed { - // Code size 36 (0x24) + // Code size 30 (0x1e) .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() - IL_000b: dup - IL_000c: ldc.i4.0 - IL_000d: ldc.i4.0 - IL_000e: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) - IL_0013: nop - IL_0014: dup - IL_0015: ldc.i4.1 - IL_0016: ldc.i4.1 - IL_0017: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) + IL_0006: ldc.i4.5 + IL_0007: newarr [mscorlib]System.Int64 + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::'8D903ECAD8D9D75B3183B23AF79F6D2E607369E3' + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) IL_001c: nop - IL_001d: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_001d: ret + } // end of method TestCases::ArrayLong + + .method public hidebysig static void ArrayULong() cil managed + { + // Code size 31 (0x1f) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.s 10 + IL_0008: newarr [mscorlib]System.UInt64 + IL_000d: dup + IL_000e: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=80' ''::'9B1F6E56D755443CC39C1969CE38FD41FD4EF4B7' + IL_0013: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0022: nop - IL_0023: ret - } // end of method TestCases::CollectionInitializerDictionaryWithEnumTypes + IL_001d: nop + IL_001e: ret + } // end of method TestCases::ArrayULong - .method public hidebysig static void NotACollectionInitializer() cil managed + .method public hidebysig static void ArrayFloat() cil managed { - // Code size 44 (0x2c) - .maxstack 2 - .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) + // Code size 30 (0x1e) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.1 - IL_0009: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_000e: nop - IL_000f: ldloc.0 - IL_0010: ldc.i4.2 - IL_0011: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0016: nop - IL_0017: ldloc.0 - IL_0018: ldc.i4.3 - IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001e: nop - IL_001f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0024: ldloc.0 - IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.6 + IL_0007: newarr [mscorlib]System.Single + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=24' ''::FBCB49C1A244C1B5781AA1DB02C5A11F68908526 + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002a: nop - IL_002b: ret - } // end of method TestCases::NotACollectionInitializer + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayFloat - .method public hidebysig static void ObjectInitializer() cil managed + .method public hidebysig static void ArrayDouble() cil managed { - // Code size 26 (0x1a) + // Code size 30 (0x1e) .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000b: dup - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: nop - IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: ldc.i4.6 + IL_0007: newarr [mscorlib]System.Double + IL_000c: dup + IL_000d: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=48' ''::DC7043B0114737ACE19A23DD755893795FD48A23 + IL_0012: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_0017: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0018: nop - IL_0019: ret - } // end of method TestCases::ObjectInitializer + IL_001c: nop + IL_001d: ret + } // end of method TestCases::ArrayDouble - .method public hidebysig static void NotAnObjectInitializer() cil managed + .method public hidebysig static void ArrayDecimal() cil managed { - // Code size 28 (0x1c) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + // Code size 98 (0x62) + .maxstack 9 IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.0 - IL_0009: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_000e: nop - IL_000f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0014: ldloc.0 - IL_0015: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.6 + IL_0007: newarr [mscorlib]System.Decimal + IL_000c: dup + IL_000d: ldc.i4.0 + IL_000e: ldc.i4.s -100 + IL_0010: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0015: stelem [mscorlib]System.Decimal + IL_001a: dup + IL_001b: ldc.i4.2 + IL_001c: ldc.i4.s 100 + IL_001e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0023: stelem [mscorlib]System.Decimal + IL_0028: dup + IL_0029: ldc.i4.3 + IL_002a: ldc.i4.m1 + IL_002b: ldc.i4.m1 + IL_002c: ldc.i4.m1 + IL_002d: ldc.i4.1 + IL_002e: ldc.i4.0 + IL_002f: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_0034: stelem [mscorlib]System.Decimal + IL_0039: dup + IL_003a: ldc.i4.4 + IL_003b: ldc.i4.m1 + IL_003c: ldc.i4.m1 + IL_003d: ldc.i4.m1 + IL_003e: ldc.i4.0 + IL_003f: ldc.i4.0 + IL_0040: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_0045: stelem [mscorlib]System.Decimal + IL_004a: dup + IL_004b: ldc.i4.5 + IL_004c: ldc.i4.1 + IL_004d: ldc.i4.0 + IL_004e: ldc.i4.0 + IL_004f: ldc.i4.0 + IL_0050: ldc.i4.7 + IL_0051: newobj instance void [mscorlib]System.Decimal::.ctor(int32, + int32, + int32, + bool, + uint8) + IL_0056: stelem [mscorlib]System.Decimal + IL_005b: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_001a: nop - IL_001b: ret - } // end of method TestCases::NotAnObjectInitializer + IL_0060: nop + IL_0061: ret + } // end of method TestCases::ArrayDecimal - .method public hidebysig static void NotAnObjectInitializerWithEvent() cil managed + .method public hidebysig static void ArrayString() cil managed { - // Code size 58 (0x3a) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + // Code size 43 (0x2b) + .maxstack 8 IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__33_0' - IL_000d: dup - IL_000e: brtrue.s IL_0027 - - IL_0010: pop - IL_0011: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9' - IL_0016: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'b__33_0'(object, - class [mscorlib]System.EventArgs) - IL_001c: newobj instance void [mscorlib]System.EventHandler::.ctor(object, - native int) - IL_0021: dup - IL_0022: stsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__33_0' - IL_0027: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) - IL_002c: nop - IL_002d: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0032: ldloc.0 - IL_0033: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldc.i4.4 + IL_0007: newarr [mscorlib]System.String + IL_000c: dup + IL_000d: ldc.i4.0 + IL_000e: ldstr "" + IL_0013: stelem.ref + IL_0014: dup + IL_0015: ldc.i4.2 + IL_0016: ldstr "Hello" + IL_001b: stelem.ref + IL_001c: dup + IL_001d: ldc.i4.3 + IL_001e: ldstr "World" + IL_0023: stelem.ref + IL_0024: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0038: nop - IL_0039: ret - } // end of method TestCases::NotAnObjectInitializerWithEvent + IL_0029: nop + IL_002a: ret + } // end of method TestCases::ArrayString - .method public hidebysig static void ObjectInitializerAssignCollectionToField() cil managed + .method public hidebysig static void ArrayEnum() cil managed { - // Code size 53 (0x35) + // Code size 27 (0x1b) .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000b: dup - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: nop - IL_0013: dup - IL_0014: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0019: dup - IL_001a: ldc.i4.0 - IL_001b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0020: nop - IL_0021: dup - IL_0022: ldc.i4.1 - IL_0023: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0028: nop - IL_0029: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_002e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: ldc.i4.4 + IL_0007: newarr ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum + IL_000c: dup + IL_000d: ldc.i4.1 + IL_000e: ldc.i4.1 + IL_000f: stelem.i4 + IL_0010: dup + IL_0011: ldc.i4.3 + IL_0012: ldc.i4.1 + IL_0013: stelem.i4 + IL_0014: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0033: nop - IL_0034: ret - } // end of method TestCases::ObjectInitializerAssignCollectionToField + IL_0019: nop + IL_001a: ret + } // end of method TestCases::ArrayEnum - .method public hidebysig static void ObjectInitializerAddToCollectionInField() cil managed + .method public hidebysig static void RecursiveArrayInitializer() cil managed { - // Code size 52 (0x34) - .maxstack 8 + // Code size 29 (0x1d) + .maxstack 4 + .locals init (int32[] V_0) IL_0000: nop - IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000b: dup - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: nop - IL_0013: dup - IL_0014: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0001: ldc.i4.3 + IL_0002: newarr [mscorlib]System.Int32 + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.0 + IL_000a: ldc.i4.1 + IL_000b: stelem.i4 + IL_000c: ldloc.0 + IL_000d: ldc.i4.1 + IL_000e: ldc.i4.2 + IL_000f: stelem.i4 + IL_0010: ldloc.0 + IL_0011: ldc.i4.2 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: ldelem.i4 + IL_0015: ldc.i4.1 + IL_0016: add + IL_0017: stelem.i4 + IL_0018: ldloc.0 IL_0019: ldc.i4.0 - IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001f: nop - IL_0020: dup - IL_0021: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0026: ldc.i4.1 - IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002c: nop - IL_002d: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0032: nop - IL_0033: ret - } // end of method TestCases::ObjectInitializerAddToCollectionInField + IL_001a: ldc.i4.0 + IL_001b: stelem.i4 + IL_001c: ret + } // end of method TestCases::RecursiveArrayInitializer - .method public hidebysig static void ObjectInitializerAssignCollectionToProperty() cil managed + .method public hidebysig static void InvalidIndices(int32 a) cil managed { - // Code size 54 (0x36) - .maxstack 8 + // Code size 25 (0x19) + .maxstack 3 + .locals init (int32[] V_0) IL_0000: nop - IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000b: dup - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: nop - IL_0013: dup - IL_0014: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() - IL_0019: dup - IL_001a: ldc.i4.0 - IL_001b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0020: nop - IL_0021: dup - IL_0022: ldc.i4.1 - IL_0023: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0028: nop - IL_0029: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_PropertyList(class [mscorlib]System.Collections.Generic.List`1) - IL_002e: nop - IL_002f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: ldc.i4.1 + IL_0002: newarr [mscorlib]System.Int32 + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: ldarg.0 + IL_000b: stelem.i4 + IL_000c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0011: ldloc.0 + IL_0012: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0034: nop - IL_0035: ret - } // end of method TestCases::ObjectInitializerAssignCollectionToProperty + IL_0017: nop + IL_0018: ret + } // end of method TestCases::InvalidIndices - .method public hidebysig static void ObjectInitializerAddToCollectionInProperty() cil managed + .method public hidebysig static void InvalidIndices2(int32 a) cil managed { - // Code size 52 (0x34) - .maxstack 8 + // Code size 25 (0x19) + .maxstack 3 + .locals init (int32[] V_0) IL_0000: nop - IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000b: dup - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0012: nop - IL_0013: dup - IL_0014: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() - IL_0019: ldc.i4.0 - IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001f: nop - IL_0020: dup - IL_0021: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() - IL_0026: ldc.i4.1 - IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002c: nop - IL_002d: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: ldc.i4.1 + IL_0002: newarr [mscorlib]System.Int32 + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.m1 + IL_000a: ldarg.0 + IL_000b: stelem.i4 + IL_000c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0011: ldloc.0 + IL_0012: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_0032: nop - IL_0033: ret - } // end of method TestCases::ObjectInitializerAddToCollectionInProperty + IL_0017: nop + IL_0018: ret + } // end of method TestCases::InvalidIndices2 - .method public hidebysig static void ObjectInitializerWithInitializationOfNestedObjects() cil managed + .method public hidebysig static void IndicesInWrongOrder(int32 a, + int32 b) cil managed { - // Code size 49 (0x31) - .maxstack 8 + // Code size 29 (0x1d) + .maxstack 3 + .locals init (int32[] V_0) IL_0000: nop - IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000b: dup - IL_000c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0011: ldc.i4.0 - IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0017: nop - IL_0018: dup - IL_0019: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_001e: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0023: ldc.i4.1 - IL_0024: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0029: nop - IL_002a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0001: ldc.i4.5 + IL_0002: newarr [mscorlib]System.Int32 + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.2 + IL_000a: ldarg.1 + IL_000b: stelem.i4 + IL_000c: ldloc.0 + IL_000d: ldc.i4.1 + IL_000e: ldarg.0 + IL_000f: stelem.i4 + IL_0010: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0015: ldloc.0 + IL_0016: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002f: nop - IL_0030: ret - } // end of method TestCases::ObjectInitializerWithInitializationOfNestedObjects + IL_001b: nop + IL_001c: ret + } // end of method TestCases::IndicesInWrongOrder - .method private hidebysig static int32 - GetInt() cil managed + .method public hidebysig static void Issue953_MissingNullableSpecifierForArrayInitializer() cil managed { - // Code size 7 (0x7) - .maxstack 1 - .locals init (int32 V_0) + // Code size 31 (0x1f) + .maxstack 8 IL_0000: nop IL_0001: ldc.i4.1 - IL_0002: stloc.0 - IL_0003: br.s IL_0005 - - IL_0005: ldloc.0 - IL_0006: ret - } // end of method TestCases::GetInt + IL_0002: newarr valuetype [mscorlib]System.Nullable`1 + IL_0007: dup + IL_0008: ldc.i4.0 + IL_0009: ldsfld valuetype [mscorlib]System.Guid [mscorlib]System.Guid::Empty + IL_000e: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0013: stelem valuetype [mscorlib]System.Nullable`1 + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::NoOp(valuetype [mscorlib]System.Nullable`1[]) + IL_001d: nop + IL_001e: ret + } // end of method TestCases::Issue953_MissingNullableSpecifierForArrayInitializer - .method private hidebysig static string - GetString() cil managed + .method private hidebysig instance void + Issue907_Test3(string text) cil managed + { + // Code size 31 (0x1f) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() + IL_000b: dup + IL_000c: ldstr "" + IL_0011: ldarg.1 + IL_0012: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0017: nop + IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001d: nop + IL_001e: ret + } // end of method TestCases::Issue907_Test3 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test1() cil managed + { + // Code size 42 (0x2a) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000d: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_0012: ldloc.0 + IL_0013: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_0018: ldc.i4.1 + IL_0019: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_001e: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.0 + IL_0025: stloc.1 + IL_0026: br.s IL_0028 + + IL_0028: ldloc.1 + IL_0029: ret + } // end of method TestCases::Test1 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test1Alternative() cil managed + { + // Code size 41 (0x29) + .maxstack 6 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + IL_0000: nop + IL_0001: ldc.i4.1 + IL_0002: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0007: dup + IL_0008: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000d: dup + IL_000e: ldc.i4.1 + IL_000f: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_0014: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0019: nop + IL_001a: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::L + IL_001f: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) + IL_0024: stloc.0 + IL_0025: br.s IL_0027 + + IL_0027: ldloc.0 + IL_0028: ret + } // end of method TestCases::Test1Alternative + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test2() cil managed + { + // Code size 27 (0x1b) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.1 + IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_000e: ldloc.0 + IL_000f: ldc.i4.2 + IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_0015: ldloc.0 + IL_0016: stloc.1 + IL_0017: br.s IL_0019 + + IL_0019: ldloc.1 + IL_001a: ret + } // end of method TestCases::Test2 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test3() cil managed + { + // Code size 37 (0x25) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.1 + IL_0009: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::.ctor(int32) + IL_000e: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0013: ldloc.0 + IL_0014: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0019: ldc.i4.2 + IL_001a: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_001f: ldloc.0 + IL_0020: stloc.1 + IL_0021: br.s IL_0023 + + IL_0023: ldloc.1 + IL_0024: ret + } // end of method TestCases::Test3 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test3b() cil managed + { + // Code size 36 (0x24) + .maxstack 4 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0) + IL_0000: nop + IL_0001: ldc.i4.0 + IL_0002: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0007: dup + IL_0008: ldc.i4.1 + IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_000e: dup + IL_000f: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0014: ldc.i4.2 + IL_0015: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_001a: call class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C) + IL_001f: stloc.0 + IL_0020: br.s IL_0022 + + IL_0022: ldloc.0 + IL_0023: ret + } // end of method TestCases::Test3b + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C + Test4() cil managed + { + // Code size 44 (0x2c) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_000d: ldc.i4.1 + IL_000e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::A + IL_0013: ldloc.0 + IL_0014: ldc.i4.2 + IL_0015: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_001a: ldloc.0 + IL_001b: ldflda valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Y + IL_0020: ldc.i4.3 + IL_0021: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/S::B + IL_0026: ldloc.0 + IL_0027: stloc.1 + IL_0028: br.s IL_002a + + IL_002a: ldloc.1 + IL_002b: ret + } // end of method TestCases::Test4 + + .method public hidebysig static void ObjectInitializer() cil managed + { + // Code size 26 (0x1a) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: nop + IL_0013: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0018: nop + IL_0019: ret + } // end of method TestCases::ObjectInitializer + + .method public hidebysig static void NotAnObjectInitializer() cil managed + { + // Code size 28 (0x1c) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.0 + IL_0009: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_000e: nop + IL_000f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0014: ldloc.0 + IL_0015: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_001a: nop + IL_001b: ret + } // end of method TestCases::NotAnObjectInitializer + + .method public hidebysig static void NotAnObjectInitializerWithEvent() cil managed + { + // Code size 58 (0x3a) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__51_0' + IL_000d: dup + IL_000e: brtrue.s IL_0027 + + IL_0010: pop + IL_0011: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9' + IL_0016: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'b__51_0'(object, + class [mscorlib]System.EventArgs) + IL_001c: newobj instance void [mscorlib]System.EventHandler::.ctor(object, + native int) + IL_0021: dup + IL_0022: stsfld class [mscorlib]System.EventHandler ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__51_0' + IL_0027: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) + IL_002c: nop + IL_002d: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0032: ldloc.0 + IL_0033: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0038: nop + IL_0039: ret + } // end of method TestCases::NotAnObjectInitializerWithEvent + + .method public hidebysig static void ObjectInitializerAssignCollectionToField() cil managed + { + // Code size 53 (0x35) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: nop + IL_0013: dup + IL_0014: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0019: dup + IL_001a: ldc.i4.0 + IL_001b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0020: nop + IL_0021: dup + IL_0022: ldc.i4.1 + IL_0023: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0028: nop + IL_0029: stfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_002e: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0033: nop + IL_0034: ret + } // end of method TestCases::ObjectInitializerAssignCollectionToField + + .method public hidebysig static void ObjectInitializerAddToCollectionInField() cil managed + { + // Code size 52 (0x34) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: nop + IL_0013: dup + IL_0014: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0019: ldc.i4.0 + IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001f: nop + IL_0020: dup + IL_0021: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0026: ldc.i4.1 + IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002c: nop + IL_002d: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0032: nop + IL_0033: ret + } // end of method TestCases::ObjectInitializerAddToCollectionInField + + .method public hidebysig static void ObjectInitializerAssignCollectionToProperty() cil managed + { + // Code size 54 (0x36) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: nop + IL_0013: dup + IL_0014: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0019: dup + IL_001a: ldc.i4.0 + IL_001b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0020: nop + IL_0021: dup + IL_0022: ldc.i4.1 + IL_0023: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0028: nop + IL_0029: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_PropertyList(class [mscorlib]System.Collections.Generic.List`1) + IL_002e: nop + IL_002f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0034: nop + IL_0035: ret + } // end of method TestCases::ObjectInitializerAssignCollectionToProperty + + .method public hidebysig static void ObjectInitializerAddToCollectionInProperty() cil managed + { + // Code size 52 (0x34) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: nop + IL_0013: dup + IL_0014: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() + IL_0019: ldc.i4.0 + IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001f: nop + IL_0020: dup + IL_0021: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() + IL_0026: ldc.i4.1 + IL_0027: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002c: nop + IL_002d: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0032: nop + IL_0033: ret + } // end of method TestCases::ObjectInitializerAddToCollectionInProperty + + .method public hidebysig static void ObjectInitializerWithInitializationOfNestedObjects() cil managed + { + // Code size 49 (0x31) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000b: dup + IL_000c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0011: ldc.i4.0 + IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0017: nop + IL_0018: dup + IL_0019: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_001e: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0023: ldc.i4.1 + IL_0024: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0029: nop + IL_002a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002f: nop + IL_0030: ret + } // end of method TestCases::ObjectInitializerWithInitializationOfNestedObjects + + .method public hidebysig static void ObjectInitializerWithInitializationOfDeeplyNestedObjects() cil managed + { + // Code size 82 (0x52) + .maxstack 4 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000b: dup + IL_000c: ldc.i4.1 + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0012: nop + IL_0013: dup + IL_0014: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0019: ldc.i4.0 + IL_001a: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_001f: nop + IL_0020: dup + IL_0021: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0026: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_002b: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0030: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0035: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_003a: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_003f: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0044: ldc.i4.1 + IL_0045: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_004a: nop + IL_004b: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0050: nop + IL_0051: ret + } // end of method TestCases::ObjectInitializerWithInitializationOfDeeplyNestedObjects + + .method public hidebysig static void CollectionInitializerInsideObjectInitializers() cil managed + { + // Code size 59 (0x3b) + .maxstack 8 + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000b: dup + IL_000c: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0011: dup + IL_0012: ldc.i4.0 + IL_0013: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0018: nop + IL_0019: dup + IL_001a: ldc.i4.1 + IL_001b: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_b(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0020: nop + IL_0021: dup + IL_0022: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() + IL_0027: ldc.i4.0 + IL_0028: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002d: nop + IL_002e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_MoreData(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) + IL_0033: nop + IL_0034: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0039: nop + IL_003a: ret + } // end of method TestCases::CollectionInitializerInsideObjectInitializers + + .method public hidebysig static void NotAStructInitializer_DefaultConstructor() cil managed + { + // Code size 44 (0x2c) + .maxstack 2 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: nop + IL_0001: ldloca.s V_0 + IL_0003: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0009: ldloca.s V_0 + IL_000b: ldc.i4.1 + IL_000c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0011: ldloca.s V_0 + IL_0013: ldc.i4.2 + IL_0014: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_0019: nop + IL_001a: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_001f: ldloc.0 + IL_0020: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002a: nop + IL_002b: ret + } // end of method TestCases::NotAStructInitializer_DefaultConstructor + + .method public hidebysig static void StructInitializer_DefaultConstructor() cil managed + { + // Code size 44 (0x2c) + .maxstack 3 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldloca.s V_0 + IL_0008: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_000e: ldloca.s V_0 + IL_0010: ldc.i4.1 + IL_0011: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0016: ldloca.s V_0 + IL_0018: ldc.i4.2 + IL_0019: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_001e: nop + IL_001f: ldloc.0 + IL_0020: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002a: nop + IL_002b: ret + } // end of method TestCases::StructInitializer_DefaultConstructor + + .method public hidebysig static void NotAStructInitializer_ExplicitConstructor() cil managed { - // Code size 11 (0xb) - .maxstack 1 - .locals init (string V_0) + // Code size 44 (0x2c) + .maxstack 2 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) IL_0000: nop - IL_0001: ldstr "Test" + IL_0001: ldloca.s V_0 + IL_0003: ldc.i4.0 + IL_0004: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) + IL_0009: ldloca.s V_0 + IL_000b: ldc.i4.1 + IL_000c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0011: ldloca.s V_0 + IL_0013: ldc.i4.2 + IL_0014: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_0019: nop + IL_001a: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_001f: ldloc.0 + IL_0020: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002a: nop + IL_002b: ret + } // end of method TestCases::NotAStructInitializer_ExplicitConstructor + + .method public hidebysig static void StructInitializer_ExplicitConstructor() cil managed + { + // Code size 44 (0x2c) + .maxstack 3 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldloca.s V_0 + IL_0008: ldc.i4.0 + IL_0009: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) + IL_000e: ldloca.s V_0 + IL_0010: ldc.i4.1 + IL_0011: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_0016: ldloca.s V_0 + IL_0018: ldc.i4.2 + IL_0019: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_001e: nop + IL_001f: ldloc.0 + IL_0020: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002a: nop + IL_002b: ret + } // end of method TestCases::StructInitializer_ExplicitConstructor + + .method public hidebysig static void StructInitializerWithInitializationOfNestedObjects() cil managed + { + // Code size 79 (0x4f) + .maxstack 3 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: ldloca.s V_0 + IL_0008: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_000e: ldloca.s V_0 + IL_0010: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() + IL_0015: ldc.i4.0 + IL_0016: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_001b: nop + IL_001c: ldloca.s V_0 + IL_001e: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() + IL_0023: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0028: ldc.i4.0 + IL_0029: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002e: nop + IL_002f: ldloca.s V_0 + IL_0031: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() + IL_0036: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_003b: ldc.i4.1 + IL_003c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0041: nop + IL_0042: ldloc.0 + IL_0043: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData + IL_0048: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_004d: nop + IL_004e: ret + } // end of method TestCases::StructInitializerWithInitializationOfNestedObjects + + .method public hidebysig static void StructInitializerWithinObjectInitializer() cil managed + { + // Code size 51 (0x33) + .maxstack 5 + .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + IL_0000: nop + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000b: dup + IL_000c: ldloca.s V_0 + IL_000e: ldc.i4.2 + IL_000f: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) + IL_0014: ldloca.s V_0 + IL_0016: ldc.i4.1 + IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field + IL_001c: ldloca.s V_0 + IL_001e: ldc.i4.2 + IL_001f: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_0024: nop + IL_0025: ldloc.0 + IL_0026: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_NestedStruct(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData) + IL_002b: nop + IL_002c: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0031: nop + IL_0032: ret + } // end of method TestCases::StructInitializerWithinObjectInitializer + + .method public hidebysig static void Issue270_NestedInitialisers() cil managed + { + // Code size 122 (0x7a) + .maxstack 8 + .locals init (class [mscorlib]System.Globalization.NumberFormatInfo[] V_0) + IL_0000: nop + IL_0001: ldnull + IL_0002: stloc.0 + IL_0003: ldc.i4.0 + IL_0004: ldnull + IL_0005: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Issue270_NestedInitialisers() + IL_000b: newobj instance void [mscorlib]System.Threading.ThreadStart::.ctor(object, + native int) + IL_0010: newobj instance void [mscorlib]System.Threading.Thread::.ctor(class [mscorlib]System.Threading.ThreadStart) + IL_0015: dup + IL_0016: ldc.i4.1 + IL_0017: callvirt instance void [mscorlib]System.Threading.Thread::set_Priority(valuetype [mscorlib]System.Threading.ThreadPriority) + IL_001c: nop + IL_001d: dup + IL_001e: ldc.i4.0 + IL_001f: newobj instance void [mscorlib]System.Globalization.CultureInfo::.ctor(int32) + IL_0024: dup + IL_0025: newobj instance void [mscorlib]System.Globalization.DateTimeFormatInfo::.ctor() + IL_002a: dup + IL_002b: ldstr "ddmmyy" + IL_0030: callvirt instance void [mscorlib]System.Globalization.DateTimeFormatInfo::set_ShortDatePattern(string) + IL_0035: nop + IL_0036: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_DateTimeFormat(class [mscorlib]System.Globalization.DateTimeFormatInfo) + IL_003b: nop + IL_003c: dup + IL_003d: ldloc.0 + IL_003e: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__65_0' + IL_0043: dup + IL_0044: brtrue.s IL_005d + + IL_0046: pop + IL_0047: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9' + IL_004c: ldftn instance bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'b__65_0'(class [mscorlib]System.Globalization.NumberFormatInfo) + IL_0052: newobj instance void class [mscorlib]System.Func`2::.ctor(object, + native int) + IL_0057: dup + IL_0058: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__65_0' + IL_005d: call class [mscorlib]System.Collections.Generic.IEnumerable`1 [System.Core]System.Linq.Enumerable::Where(class [mscorlib]System.Collections.Generic.IEnumerable`1, + class [mscorlib]System.Func`2) + IL_0062: call !!0 [System.Core]System.Linq.Enumerable::First(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0067: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_NumberFormat(class [mscorlib]System.Globalization.NumberFormatInfo) + IL_006c: nop + IL_006d: callvirt instance void [mscorlib]System.Threading.Thread::set_CurrentCulture(class [mscorlib]System.Globalization.CultureInfo) + IL_0072: nop + IL_0073: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, + class [mscorlib]System.Threading.Thread) + IL_0078: nop + IL_0079: ret + } // end of method TestCases::Issue270_NestedInitialisers + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 + Issue1345() cil managed + { + // Code size 36 (0x24) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() IL_0006: stloc.0 - IL_0007: br.s IL_0009 + IL_0007: ldloc.0 + IL_0008: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::Data + IL_000d: ldc.i4.3 + IL_000e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_001d: nop + IL_001e: ldloc.0 + IL_001f: stloc.1 + IL_0020: br.s IL_0022 - IL_0009: ldloc.0 - IL_000a: ret - } // end of method TestCases::GetString + IL_0022: ldloc.1 + IL_0023: ret + } // end of method TestCases::Issue1345 + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 + Issue1345b() cil managed + { + // Code size 36 (0x24) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data2() + IL_000d: ldc.i4.3 + IL_000e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_001d: nop + IL_001e: ldloc.0 + IL_001f: stloc.1 + IL_0020: br.s IL_0022 + + IL_0022: ldloc.1 + IL_0023: ret + } // end of method TestCases::Issue1345b + + .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 + Issue1345c() cil managed + { + // Code size 36 (0x24) + .maxstack 2 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_1) + IL_0000: nop + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data3() + IL_000d: ldc.i4.3 + IL_000e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) + IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) + IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) + IL_001d: nop + IL_001e: ldloc.0 + IL_001f: stloc.1 + IL_0020: br.s IL_0022 + + IL_0022: ldloc.1 + IL_0023: ret + } // end of method TestCases::Issue1345c - .method private hidebysig static void NoOp(valuetype [mscorlib]System.Nullable`1[] 'array') cil managed + .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data + Issue1345_FalsePositive() cil managed { - // Code size 2 (0x2) - .maxstack 8 + // Code size 37 (0x25) + .maxstack 3 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) IL_0000: nop - IL_0001: ret - } // end of method TestCases::NoOp + IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0006: dup + IL_0007: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_ReadOnlyPropertyList() + IL_000c: ldc.i4.0 + IL_000d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0012: nop + IL_0013: dup + IL_0014: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_ReadOnlyPropertyList() + IL_0019: ldc.i4.1 + IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001f: nop + IL_0020: stloc.0 + IL_0021: br.s IL_0023 - .method public hidebysig static void SimpleDictInitializer() cil managed + IL_0023: ldloc.0 + IL_0024: ret + } // end of method TestCases::Issue1345_FalsePositive + + .method private hidebysig instance void + Issue1250_Test1(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum 'value') cil managed { - // Code size 45 (0x2d) + // Code size 25 (0x19) .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() IL_000b: dup - IL_000c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0011: ldc.i4.0 - IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0017: nop - IL_0018: dup - IL_0019: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_001e: ldc.i4.2 - IL_001f: ldnull - IL_0020: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) - IL_0025: nop - IL_0026: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_000c: ldarg.1 + IL_000d: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z + IL_0012: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002b: nop - IL_002c: ret - } // end of method TestCases::SimpleDictInitializer - - .method public hidebysig static void MixedObjectAndDictInitializer() cil managed - { - // Code size 137 (0x89) - .maxstack 6 - .locals init (int32 V_0, - int32 V_1, - string V_2) - IL_0000: nop - IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000b: dup - IL_000c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0011: ldc.i4.0 - IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) IL_0017: nop - IL_0018: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetInt() - IL_001d: stloc.0 - IL_001e: dup - IL_001f: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0024: ldloc.0 - IL_0025: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) - IL_002a: ldc.i4.1 - IL_002b: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0030: nop - IL_0031: dup - IL_0032: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0037: ldloc.0 - IL_0038: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) - IL_003d: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0042: ldc.i4.0 - IL_0043: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0048: nop - IL_0049: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetInt() - IL_004e: stloc.1 - IL_004f: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetString() - IL_0054: stloc.2 - IL_0055: dup - IL_0056: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_005b: ldloc.0 - IL_005c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) - IL_0061: ldloc.1 - IL_0062: ldloc.2 - IL_0063: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0068: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, - string, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) - IL_006d: nop - IL_006e: dup - IL_006f: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0074: ldloc.0 - IL_0075: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) - IL_007a: ldc.i4.2 - IL_007b: ldnull - IL_007c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) - IL_0081: nop - IL_0082: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0087: nop - IL_0088: ret - } // end of method TestCases::MixedObjectAndDictInitializer + IL_0018: ret + } // end of method TestCases::Issue1250_Test1 .method private hidebysig instance void - NestedListWithIndexInitializer(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum myEnum) cil managed - { - // Code size 64 (0x40) - .maxstack 3 - .locals init (class [mscorlib]System.Collections.Generic.List`1> V_0) - IL_0000: nop - IL_0001: newobj instance void class [mscorlib]System.Collections.Generic.List`1>::.ctor() - IL_0006: dup - IL_0007: ldc.i4.0 - IL_0008: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) - IL_000d: ldc.i4.1 - IL_000e: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0013: nop - IL_0014: dup - IL_0015: ldc.i4.0 - IL_0016: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) - IL_001b: ldc.i4.2 - IL_001c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0021: nop - IL_0022: dup - IL_0023: ldc.i4.0 - IL_0024: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) - IL_0029: ldc.i4.3 - IL_002a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002f: nop - IL_0030: dup - IL_0031: ldc.i4.1 - IL_0032: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) - IL_0037: ldarg.1 - IL_0038: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_003d: nop - IL_003e: stloc.0 - IL_003f: ret - } // end of method TestCases::NestedListWithIndexInitializer - - .method public hidebysig static void ObjectInitializerWithInitializationOfDeeplyNestedObjects() cil managed + Issue1251_Test(class [mscorlib]System.Collections.Generic.List`1 list, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem otherItem) cil managed { - // Code size 82 (0x52) + // Code size 160 (0xa0) .maxstack 4 + .locals init (valuetype [mscorlib]System.Nullable`1 V_0) IL_0000: nop - IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000b: dup - IL_000c: ldc.i4.1 - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0001: ldarg.1 + IL_0002: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::.ctor() + IL_0007: dup + IL_0008: ldstr "Text" + IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Text(string) IL_0012: nop IL_0013: dup - IL_0014: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0019: ldc.i4.0 - IL_001a: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0014: ldarg.2 + IL_0015: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value() + IL_001a: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value(valuetype [mscorlib]System.Decimal) IL_001f: nop IL_0020: dup - IL_0021: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0026: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_002b: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0030: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0035: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_003a: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_003f: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() - IL_0044: ldc.i4.1 - IL_0045: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_004a: nop - IL_004b: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0050: nop - IL_0051: ret - } // end of method TestCases::ObjectInitializerWithInitializationOfDeeplyNestedObjects - - .method public hidebysig static void CollectionInitializerInsideObjectInitializers() cil managed - { - // Code size 59 (0x3b) - .maxstack 8 - IL_0000: nop - IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000b: dup - IL_000c: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0011: dup - IL_0012: ldc.i4.0 - IL_0013: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0018: nop - IL_0019: dup - IL_001a: ldc.i4.1 - IL_001b: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_b(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0020: nop - IL_0021: dup - IL_0022: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_PropertyList() - IL_0027: ldc.i4.0 - IL_0028: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002d: nop - IL_002e: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_MoreData(class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) - IL_0033: nop - IL_0034: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_0039: nop - IL_003a: ret - } // end of method TestCases::CollectionInitializerInsideObjectInitializers + IL_0021: ldarg.2 + IL_0022: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value2() + IL_0027: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value2(valuetype [mscorlib]System.Decimal) + IL_002c: nop + IL_002d: dup + IL_002e: ldarg.2 + IL_002f: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable() + IL_0034: stloc.0 + IL_0035: ldloca.s V_0 + IL_0037: constrained. valuetype [mscorlib]System.Nullable`1 + IL_003d: callvirt instance string [mscorlib]System.Object::ToString() + IL_0042: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value3(string) + IL_0047: nop + IL_0048: dup + IL_0049: ldarg.2 + IL_004a: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable2() + IL_004f: stloc.0 + IL_0050: ldloca.s V_0 + IL_0052: constrained. valuetype [mscorlib]System.Nullable`1 + IL_0058: callvirt instance string [mscorlib]System.Object::ToString() + IL_005d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value4(string) + IL_0062: nop + IL_0063: dup + IL_0064: ldarg.2 + IL_0065: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable3() + IL_006a: stloc.0 + IL_006b: ldloca.s V_0 + IL_006d: constrained. valuetype [mscorlib]System.Nullable`1 + IL_0073: callvirt instance string [mscorlib]System.Object::ToString() + IL_0078: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value5(string) + IL_007d: nop + IL_007e: dup + IL_007f: ldarg.2 + IL_0080: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable4() + IL_0085: stloc.0 + IL_0086: ldloca.s V_0 + IL_0088: constrained. valuetype [mscorlib]System.Nullable`1 + IL_008e: callvirt instance string [mscorlib]System.Object::ToString() + IL_0093: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value6(string) + IL_0098: nop + IL_0099: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_009e: nop + IL_009f: ret + } // end of method TestCases::Issue1251_Test - .method public hidebysig static void NotAStructInitializer_DefaultConstructor() cil managed + .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data + Issue1279(int32 p) cil managed { - // Code size 44 (0x2c) - .maxstack 2 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + // Code size 53 (0x35) + .maxstack 3 + .locals init (bool V_0, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_1, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_2) IL_0000: nop - IL_0001: ldloca.s V_0 - IL_0003: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0009: ldloca.s V_0 - IL_000b: ldc.i4.1 - IL_000c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0011: ldloca.s V_0 - IL_0013: ldc.i4.2 - IL_0014: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_0019: nop - IL_001a: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_001f: ldloc.0 - IL_0020: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) + IL_0001: ldarg.1 + IL_0002: ldc.i4.1 + IL_0003: ceq + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: brfalse.s IL_002f + + IL_0009: nop + IL_000a: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_000f: stloc.1 + IL_0010: ldloc.1 + IL_0011: ldc.i4.0 + IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0017: nop + IL_0018: ldloc.1 + IL_0019: ldarg.0 + IL_001a: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Data_TestEvent(object, + class [mscorlib]System.EventArgs) + IL_0020: newobj instance void [mscorlib]System.EventHandler::.ctor(object, + native int) + IL_0025: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) IL_002a: nop - IL_002b: ret - } // end of method TestCases::NotAStructInitializer_DefaultConstructor + IL_002b: ldloc.1 + IL_002c: stloc.2 + IL_002d: br.s IL_0033 - .method public hidebysig static void StructInitializer_DefaultConstructor() cil managed + IL_002f: ldnull + IL_0030: stloc.2 + IL_0031: br.s IL_0033 + + IL_0033: ldloc.2 + IL_0034: ret + } // end of method TestCases::Issue1279 + + .method public hidebysig static void ExtensionMethodInCollectionInitializer() cil managed { - // Code size 44 (0x2c) - .maxstack 3 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + // Code size 41 (0x29) + .maxstack 6 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: ldloca.s V_0 - IL_0008: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_000e: ldloca.s V_0 - IL_0010: ldc.i4.1 - IL_0011: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0016: ldloca.s V_0 - IL_0018: ldc.i4.2 - IL_0019: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_001e: nop - IL_001f: ldloc.0 - IL_0020: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.2 + IL_000e: newarr [mscorlib]System.Int32 + IL_0013: dup + IL_0014: ldc.i4.0 + IL_0015: ldc.i4.1 + IL_0016: stelem.i4 + IL_0017: dup + IL_0018: ldc.i4.1 + IL_0019: ldc.i4.2 + IL_001a: stelem.i4 + IL_001b: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) + IL_0020: nop + IL_0021: ldloc.0 + IL_0022: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002a: nop - IL_002b: ret - } // end of method TestCases::StructInitializer_DefaultConstructor + IL_0027: nop + IL_0028: ret + } // end of method TestCases::ExtensionMethodInCollectionInitializer - .method public hidebysig static void NotAStructInitializer_ExplicitConstructor() cil managed + .method public hidebysig static void NoCollectionInitializerBecauseOfTypeArguments() cil managed { - // Code size 44 (0x2c) + // Code size 27 (0x1b) .maxstack 2 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) IL_0000: nop - IL_0001: ldloca.s V_0 - IL_0003: ldc.i4.0 - IL_0004: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) - IL_0009: ldloca.s V_0 - IL_000b: ldc.i4.1 - IL_000c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0011: ldloca.s V_0 - IL_0013: ldc.i4.2 - IL_0014: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_0001: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldstr "int" + IL_000d: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(string) + IL_0012: nop + IL_0013: ldloc.0 + IL_0014: call void [mscorlib]System.Console::WriteLine(object) IL_0019: nop - IL_001a: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_001f: ldloc.0 - IL_0020: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) - IL_002a: nop - IL_002b: ret - } // end of method TestCases::NotAStructInitializer_ExplicitConstructor + IL_001a: ret + } // end of method TestCases::NoCollectionInitializerBecauseOfTypeArguments - .method public hidebysig static void StructInitializer_ExplicitConstructor() cil managed + .method public hidebysig static void CollectionInitializerWithParamsMethod() cil managed { - // Code size 44 (0x2c) - .maxstack 3 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + // Code size 45 (0x2d) + .maxstack 5 + .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1 V_0) IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: ldloca.s V_0 - IL_0008: ldc.i4.0 - IL_0009: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) - IL_000e: ldloca.s V_0 - IL_0010: ldc.i4.1 - IL_0011: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_0016: ldloca.s V_0 - IL_0018: ldc.i4.2 - IL_0019: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) - IL_001e: nop - IL_001f: ldloc.0 - IL_0020: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: newobj instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::.ctor() + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: ldc.i4.s 10 + IL_000f: newarr [mscorlib]System.Int32 + IL_0014: dup + IL_0015: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=40' ''::E0D2592373A0C161E56E266306CD8405CD719D19 + IL_001a: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, + valuetype [mscorlib]System.RuntimeFieldHandle) + IL_001f: callvirt instance void class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/CustomList`1::Add(int32[]) + IL_0024: nop + IL_0025: ldloc.0 + IL_0026: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_002a: nop - IL_002b: ret - } // end of method TestCases::StructInitializer_ExplicitConstructor + IL_002b: nop + IL_002c: ret + } // end of method TestCases::CollectionInitializerWithParamsMethod - .method public hidebysig static void StructInitializerWithInitializationOfNestedObjects() cil managed + .method public hidebysig static void CollectionInitializerList() cil managed { - // Code size 79 (0x4f) - .maxstack 3 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + // Code size 42 (0x2a) + .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: ldloca.s V_0 - IL_0008: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_000e: ldloca.s V_0 - IL_0010: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() - IL_0015: ldc.i4.0 - IL_0016: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_001b: nop - IL_001c: ldloca.s V_0 - IL_001e: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() - IL_0023: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_0028: ldc.i4.0 - IL_0029: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_002e: nop - IL_002f: ldloca.s V_0 - IL_0031: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::get_MoreData() - IL_0036: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList - IL_003b: ldc.i4.1 - IL_003c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0041: nop - IL_0042: ldloc.0 - IL_0043: box ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData - IL_0048: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_000b: dup + IL_000c: ldc.i4.1 + IL_000d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0012: nop + IL_0013: dup + IL_0014: ldc.i4.2 + IL_0015: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001a: nop + IL_001b: dup + IL_001c: ldc.i4.3 + IL_001d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0022: nop + IL_0023: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_004d: nop - IL_004e: ret - } // end of method TestCases::StructInitializerWithInitializationOfNestedObjects + IL_0028: nop + IL_0029: ret + } // end of method TestCases::CollectionInitializerList - .method public hidebysig static void StructInitializerWithinObjectInitializer() cil managed + .method public hidebysig static object + RecursiveCollectionInitializer() cil managed { - // Code size 51 (0x33) - .maxstack 5 - .locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData V_0) + // Code size 21 (0x15) + .maxstack 2 + .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0, + object V_1) + IL_0000: nop + IL_0001: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldloc.0 + IL_0009: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000e: nop + IL_000f: ldloc.0 + IL_0010: stloc.1 + IL_0011: br.s IL_0013 + + IL_0013: ldloc.1 + IL_0014: ret + } // end of method TestCases::RecursiveCollectionInitializer + + .method public hidebysig static void CollectionInitializerDictionary() cil managed + { + // Code size 57 (0x39) + .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() IL_000b: dup - IL_000c: ldloca.s V_0 - IL_000e: ldc.i4.2 - IL_000f: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::.ctor(int32) - IL_0014: ldloca.s V_0 - IL_0016: ldc.i4.1 - IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::Field - IL_001c: ldloca.s V_0 + IL_000c: ldstr "First" + IL_0011: ldc.i4.1 + IL_0012: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0017: nop + IL_0018: dup + IL_0019: ldstr "Second" IL_001e: ldc.i4.2 - IL_001f: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData::set_Property(int32) + IL_001f: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) IL_0024: nop - IL_0025: ldloc.0 - IL_0026: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_NestedStruct(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/StructData) - IL_002b: nop - IL_002c: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) + IL_0025: dup + IL_0026: ldstr "Third" + IL_002b: ldc.i4.3 + IL_002c: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) IL_0031: nop - IL_0032: ret - } // end of method TestCases::StructInitializerWithinObjectInitializer + IL_0032: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0037: nop + IL_0038: ret + } // end of method TestCases::CollectionInitializerDictionary - .method public hidebysig static void Bug270_NestedInitialisers() cil managed + .method public hidebysig static void CollectionInitializerDictionaryWithEnumTypes() cil managed { - // Code size 122 (0x7a) + // Code size 36 (0x24) .maxstack 8 - .locals init (class [mscorlib]System.Globalization.NumberFormatInfo[] V_0) IL_0000: nop - IL_0001: ldnull - IL_0002: stloc.0 - IL_0003: ldc.i4.0 - IL_0004: ldnull - IL_0005: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Bug270_NestedInitialisers() - IL_000b: newobj instance void [mscorlib]System.Threading.ThreadStart::.ctor(object, - native int) - IL_0010: newobj instance void [mscorlib]System.Threading.Thread::.ctor(class [mscorlib]System.Threading.ThreadStart) - IL_0015: dup + IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() + IL_000b: dup + IL_000c: ldc.i4.0 + IL_000d: ldc.i4.0 + IL_000e: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) + IL_0013: nop + IL_0014: dup + IL_0015: ldc.i4.1 IL_0016: ldc.i4.1 - IL_0017: callvirt instance void [mscorlib]System.Threading.Thread::set_Priority(valuetype [mscorlib]System.Threading.ThreadPriority) + IL_0017: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, + !1) IL_001c: nop - IL_001d: dup - IL_001e: ldc.i4.0 - IL_001f: newobj instance void [mscorlib]System.Globalization.CultureInfo::.ctor(int32) - IL_0024: dup - IL_0025: newobj instance void [mscorlib]System.Globalization.DateTimeFormatInfo::.ctor() - IL_002a: dup - IL_002b: ldstr "ddmmyy" - IL_0030: callvirt instance void [mscorlib]System.Globalization.DateTimeFormatInfo::set_ShortDatePattern(string) - IL_0035: nop - IL_0036: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_DateTimeFormat(class [mscorlib]System.Globalization.DateTimeFormatInfo) - IL_003b: nop - IL_003c: dup - IL_003d: ldloc.0 - IL_003e: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__53_0' - IL_0043: dup - IL_0044: brtrue.s IL_005d - - IL_0046: pop - IL_0047: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9' - IL_004c: ldftn instance bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'b__53_0'(class [mscorlib]System.Globalization.NumberFormatInfo) - IL_0052: newobj instance void class [mscorlib]System.Func`2::.ctor(object, - native int) - IL_0057: dup - IL_0058: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/'<>c'::'<>9__53_0' - IL_005d: call class [mscorlib]System.Collections.Generic.IEnumerable`1 [System.Core]System.Linq.Enumerable::Where(class [mscorlib]System.Collections.Generic.IEnumerable`1, - class [mscorlib]System.Func`2) - IL_0062: call !!0 [System.Core]System.Linq.Enumerable::First(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0067: callvirt instance void [mscorlib]System.Globalization.CultureInfo::set_NumberFormat(class [mscorlib]System.Globalization.NumberFormatInfo) - IL_006c: nop - IL_006d: callvirt instance void [mscorlib]System.Threading.Thread::set_CurrentCulture(class [mscorlib]System.Globalization.CultureInfo) - IL_0072: nop - IL_0073: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::TestCall(int32, - class [mscorlib]System.Threading.Thread) - IL_0078: nop - IL_0079: ret - } // end of method TestCases::Bug270_NestedInitialisers + IL_001d: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0022: nop + IL_0023: ret + } // end of method TestCases::CollectionInitializerDictionaryWithEnumTypes - .method public hidebysig static void Bug953_MissingNullableSpecifierForArrayInitializer() cil managed + .method public hidebysig static void NotACollectionInitializer() cil managed { - // Code size 31 (0x1f) - .maxstack 8 + // Code size 44 (0x2c) + .maxstack 2 + .locals init (class [mscorlib]System.Collections.Generic.List`1 V_0) IL_0000: nop - IL_0001: ldc.i4.1 - IL_0002: newarr valuetype [mscorlib]System.Nullable`1 - IL_0007: dup - IL_0008: ldc.i4.0 - IL_0009: ldsfld valuetype [mscorlib]System.Guid [mscorlib]System.Guid::Empty - IL_000e: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0013: stelem valuetype [mscorlib]System.Nullable`1 - IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::NoOp(valuetype [mscorlib]System.Nullable`1[]) - IL_001d: nop - IL_001e: ret - } // end of method TestCases::Bug953_MissingNullableSpecifierForArrayInitializer + IL_0001: newobj instance void class [mscorlib]System.Collections.Generic.List`1::.ctor() + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.1 + IL_0009: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000e: nop + IL_000f: ldloc.0 + IL_0010: ldc.i4.2 + IL_0011: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0016: nop + IL_0017: ldloc.0 + IL_0018: ldc.i4.3 + IL_0019: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_001e: nop + IL_001f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() + IL_0024: ldloc.0 + IL_0025: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_002a: nop + IL_002b: ret + } // end of method TestCases::NotACollectionInitializer - .method private hidebysig instance void - Issue907_Test3(string text) cil managed + .method public hidebysig static void SimpleDictInitializer() cil managed { - // Code size 31 (0x1f) + // Code size 45 (0x2d) .maxstack 8 IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void class [mscorlib]System.Collections.Generic.Dictionary`2::.ctor() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() IL_000b: dup - IL_000c: ldstr "" - IL_0011: ldarg.1 - IL_0012: callvirt instance void class [mscorlib]System.Collections.Generic.Dictionary`2::Add(!0, - !1) + IL_000c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0011: ldc.i4.0 + IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) IL_0017: nop - IL_0018: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + IL_0018: dup + IL_0019: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_001e: ldc.i4.2 + IL_001f: ldnull + IL_0020: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) + IL_0025: nop + IL_0026: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, object) - IL_001d: nop - IL_001e: ret - } // end of method TestCases::Issue907_Test3 + IL_002b: nop + IL_002c: ret + } // end of method TestCases::SimpleDictInitializer - .method private hidebysig instance void - Issue1250_Test1(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum 'value') cil managed + .method public hidebysig static void MixedObjectAndDictInitializer() cil managed { - // Code size 25 (0x19) - .maxstack 8 + // Code size 137 (0x89) + .maxstack 6 + .locals init (int32 V_0, + int32 V_1, + string V_2) IL_0000: nop IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Y() - IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::.ctor() + IL_0006: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() IL_000b: dup - IL_000c: ldarg.1 - IL_000d: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/C::Z - IL_0012: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, - object) + IL_000c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0011: ldc.i4.0 + IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) IL_0017: nop - IL_0018: ret - } // end of method TestCases::Issue1250_Test1 + IL_0018: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetInt() + IL_001d: stloc.0 + IL_001e: dup + IL_001f: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0024: ldloc.0 + IL_0025: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) + IL_002a: ldc.i4.1 + IL_002b: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) + IL_0030: nop + IL_0031: dup + IL_0032: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0037: ldloc.0 + IL_0038: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) + IL_003d: ldfld class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::FieldList + IL_0042: ldc.i4.0 + IL_0043: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0048: nop + IL_0049: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetInt() + IL_004e: stloc.1 + IL_004f: call string ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::GetString() + IL_0054: stloc.2 + IL_0055: dup + IL_0056: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_005b: ldloc.0 + IL_005c: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) + IL_0061: ldloc.1 + IL_0062: ldloc.2 + IL_0063: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() + IL_0068: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, + string, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) + IL_006d: nop + IL_006e: dup + IL_006f: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_MoreData() + IL_0074: ldloc.0 + IL_0075: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_Item(int32) + IL_007a: ldc.i4.2 + IL_007b: ldnull + IL_007c: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_Item(int32, + class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data) + IL_0081: nop + IL_0082: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::X(object, + object) + IL_0087: nop + IL_0088: ret + } // end of method TestCases::MixedObjectAndDictInitializer + + .method private hidebysig instance void + NestedListWithIndexInitializer(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum myEnum) cil managed + { + // Code size 64 (0x40) + .maxstack 3 + .locals init (class [mscorlib]System.Collections.Generic.List`1> V_0) + IL_0000: nop + IL_0001: newobj instance void class [mscorlib]System.Collections.Generic.List`1>::.ctor() + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) + IL_000d: ldc.i4.1 + IL_000e: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0013: nop + IL_0014: dup + IL_0015: ldc.i4.0 + IL_0016: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) + IL_001b: ldc.i4.2 + IL_001c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0021: nop + IL_0022: dup + IL_0023: ldc.i4.0 + IL_0024: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) + IL_0029: ldc.i4.3 + IL_002a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_002f: nop + IL_0030: dup + IL_0031: ldc.i4.1 + IL_0032: callvirt instance !0 class [mscorlib]System.Collections.Generic.List`1>::get_Item(int32) + IL_0037: ldarg.1 + IL_0038: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_003d: nop + IL_003e: stloc.0 + IL_003f: ret + } // end of method TestCases::NestedListWithIndexInitializer .method private hidebysig instance void Issue1250_Test2(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum 'value') cil managed @@ -2522,225 +3361,6 @@ IL_0026: ret } // end of method TestCases::Issue1250_Test4 - .method private hidebysig instance void - Issue1251_Test(class [mscorlib]System.Collections.Generic.List`1 list, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem otherItem) cil managed - { - // Code size 160 (0xa0) - .maxstack 4 - .locals init (valuetype [mscorlib]System.Nullable`1 V_0) - IL_0000: nop - IL_0001: ldarg.1 - IL_0002: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::.ctor() - IL_0007: dup - IL_0008: ldstr "Text" - IL_000d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Text(string) - IL_0012: nop - IL_0013: dup - IL_0014: ldarg.2 - IL_0015: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value() - IL_001a: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value(valuetype [mscorlib]System.Decimal) - IL_001f: nop - IL_0020: dup - IL_0021: ldarg.2 - IL_0022: callvirt instance valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Value2() - IL_0027: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value2(valuetype [mscorlib]System.Decimal) - IL_002c: nop - IL_002d: dup - IL_002e: ldarg.2 - IL_002f: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable() - IL_0034: stloc.0 - IL_0035: ldloca.s V_0 - IL_0037: constrained. valuetype [mscorlib]System.Nullable`1 - IL_003d: callvirt instance string [mscorlib]System.Object::ToString() - IL_0042: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value3(string) - IL_0047: nop - IL_0048: dup - IL_0049: ldarg.2 - IL_004a: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable2() - IL_004f: stloc.0 - IL_0050: ldloca.s V_0 - IL_0052: constrained. valuetype [mscorlib]System.Nullable`1 - IL_0058: callvirt instance string [mscorlib]System.Object::ToString() - IL_005d: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value4(string) - IL_0062: nop - IL_0063: dup - IL_0064: ldarg.2 - IL_0065: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable3() - IL_006a: stloc.0 - IL_006b: ldloca.s V_0 - IL_006d: constrained. valuetype [mscorlib]System.Nullable`1 - IL_0073: callvirt instance string [mscorlib]System.Object::ToString() - IL_0078: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value5(string) - IL_007d: nop - IL_007e: dup - IL_007f: ldarg.2 - IL_0080: callvirt instance valuetype [mscorlib]System.Nullable`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::get_Nullable4() - IL_0085: stloc.0 - IL_0086: ldloca.s V_0 - IL_0088: constrained. valuetype [mscorlib]System.Nullable`1 - IL_008e: callvirt instance string [mscorlib]System.Object::ToString() - IL_0093: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Item::set_Value6(string) - IL_0098: nop - IL_0099: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_009e: nop - IL_009f: ret - } // end of method TestCases::Issue1251_Test - - .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data - Issue1279(int32 p) cil managed - { - // Code size 53 (0x35) - .maxstack 3 - .locals init (bool V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_1, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_2) - IL_0000: nop - IL_0001: ldarg.1 - IL_0002: ldc.i4.1 - IL_0003: ceq - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: brfalse.s IL_002f - - IL_0009: nop - IL_000a: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_000f: stloc.1 - IL_0010: ldloc.1 - IL_0011: ldc.i4.0 - IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::set_a(valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/MyEnum) - IL_0017: nop - IL_0018: ldloc.1 - IL_0019: ldarg.0 - IL_001a: ldftn instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases::Data_TestEvent(object, - class [mscorlib]System.EventArgs) - IL_0020: newobj instance void [mscorlib]System.EventHandler::.ctor(object, - native int) - IL_0025: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::add_TestEvent(class [mscorlib]System.EventHandler) - IL_002a: nop - IL_002b: ldloc.1 - IL_002c: stloc.2 - IL_002d: br.s IL_0033 - - IL_002f: ldnull - IL_0030: stloc.2 - IL_0031: br.s IL_0033 - - IL_0033: ldloc.2 - IL_0034: ret - } // end of method TestCases::Issue1279 - - .method private hidebysig instance void - Data_TestEvent(object sender, - class [mscorlib]System.EventArgs e) cil managed - { - // Code size 7 (0x7) - .maxstack 8 - IL_0000: nop - IL_0001: newobj instance void [mscorlib]System.NotImplementedException::.ctor() - IL_0006: throw - } // end of method TestCases::Data_TestEvent - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 - Issue1345() cil managed - { - // Code size 36 (0x24) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_1) - IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::Data - IL_000d: ldc.i4.3 - IL_000e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) - IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) - IL_001d: nop - IL_001e: ldloc.0 - IL_001f: stloc.1 - IL_0020: br.s IL_0022 - - IL_0022: ldloc.1 - IL_0023: ret - } // end of method TestCases::Issue1345 - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 - Issue1345b() cil managed - { - // Code size 36 (0x24) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_1) - IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data2() - IL_000d: ldc.i4.3 - IL_000e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) - IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) - IL_001d: nop - IL_001e: ldloc.0 - IL_001f: stloc.1 - IL_0020: br.s IL_0022 - - IL_0022: ldloc.1 - IL_0023: ret - } // end of method TestCases::Issue1345b - - .method public hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 - Issue1345c() cil managed - { - // Code size 36 (0x24) - .maxstack 2 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_0, - class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2 V_1) - IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::.ctor() - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: callvirt instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem2::get_Data3() - IL_000d: ldc.i4.3 - IL_000e: newobj instance void [mscorlib]System.Decimal::.ctor(int32) - IL_0013: newobj instance void valuetype [mscorlib]System.Nullable`1::.ctor(!0) - IL_0018: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/OtherItem::set_Nullable(valuetype [mscorlib]System.Nullable`1) - IL_001d: nop - IL_001e: ldloc.0 - IL_001f: stloc.1 - IL_0020: br.s IL_0022 - - IL_0022: ldloc.1 - IL_0023: ret - } // end of method TestCases::Issue1345c - - .method private hidebysig instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data - Issue1345_FalsePositive() cil managed - { - // Code size 37 (0x25) - .maxstack 3 - .locals init (class ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data V_0) - IL_0000: nop - IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::.ctor() - IL_0006: dup - IL_0007: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_ReadOnlyPropertyList() - IL_000c: ldc.i4.0 - IL_000d: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_0012: nop - IL_0013: dup - IL_0014: callvirt instance class [mscorlib]System.Collections.Generic.List`1 ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests.TestCases/Data::get_ReadOnlyPropertyList() - IL_0019: ldc.i4.1 - IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) - IL_001f: nop - IL_0020: stloc.0 - IL_0021: br.s IL_0023 - - IL_0023: ldloc.0 - IL_0024: ret - } // end of method TestCases::Issue1345_FalsePositive - .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { @@ -2758,6 +3378,27 @@ extends [mscorlib]System.Object { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=10' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 10 + } // end of class '__StaticArrayInitTypeSize=10' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=12' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 12 + } // end of class '__StaticArrayInitTypeSize=12' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=24' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 24 + } // end of class '__StaticArrayInitTypeSize=24' + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=40' extends [mscorlib]System.ValueType { @@ -2765,14 +3406,80 @@ .size 40 } // end of class '__StaticArrayInitTypeSize=40' - .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=40' E0D2592373A0C161E56E266306CD8405CD719D19 at I_00005764 + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=48' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 48 + } // end of class '__StaticArrayInitTypeSize=48' + + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=80' + extends [mscorlib]System.ValueType + { + .pack 1 + .size 80 + } // end of class '__StaticArrayInitTypeSize=80' + + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=10' '20E3FF489634E18F3F7EB292AD504DBAE9519293' at I_0000627C + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=10' '56D9EEC8EF899644C40B9BE9D886DF2367A5D078' at I_0000628C + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=12' '735E5A21849E86F68D220F06163E8C5C6376B9C9' at I_0000629C + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=40' '8D903ECAD8D9D75B3183B23AF79F6D2E607369E3' at I_000062AC + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=80' '9B1F6E56D755443CC39C1969CE38FD41FD4EF4B7' at I_000062D4 + .field static assembly initonly int64 A6296CAC471BE2954899600137940479D8073C7C at I_00006324 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=40' B9583930B842DBCEF0D7B8E57D4D3F1E8055C39E at I_0000632C + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=24' C4E70AB31EF6C8908F896CAD1C6BC75F7FA65E27 at I_00006354 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=48' DC7043B0114737ACE19A23DD755893795FD48A23 at I_0000636C + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=40' E0D2592373A0C161E56E266306CD8405CD719D19 at I_0000639C + .field static assembly initonly int64 EB0715DBB235F3F696F2C404F5839C6650640898 at I_000063C4 + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=40' F514FF55B79BCAA2CEC9B56C062D976E45F89AB7 at I_000063CC + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=24' FBCB49C1A244C1B5781AA1DB02C5A11F68908526 at I_000063F4 } // end of class '' // ============================================================= -.data cil I_00005764 = bytearray ( +.data cil I_0000627C = bytearray ( + 01 02 03 04 05 06 07 08 FE FF) +.data cil I_00006286 = int8[2] +.data cil I_0000628C = bytearray ( + 00 80 FF FF 00 00 01 00 FF 7F) +.data cil I_00006296 = int8[2] +.data cil I_0000629C = bytearray ( + 00 00 01 00 FF 7F 00 80 FE FF FF FF) +.data cil I_000062AC = bytearray ( + 01 00 0C BB 7D 6E 9C BA FF FF FF FF FF FF FF FF // ....}n.......... + 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 + FF FF F3 44 82 91 63 45) // ...D..cE +.data cil I_000062D4 = bytearray ( + 01 00 00 00 00 00 00 00 00 94 35 77 00 00 00 00 // ..........5w.... + 00 5E D0 B2 00 00 00 00 04 00 00 00 00 00 00 00 // .^.............. + 05 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 + 07 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 + FF FF F3 44 82 91 63 45 FF FF E7 89 04 23 C7 8A) // ...D..cE.....#.. +.data cil I_00006324 = bytearray ( + 80 81 00 01 02 03 04 7F) +.data cil I_0000632C = bytearray ( + 01 00 00 00 00 94 35 77 00 5E D0 B2 04 00 00 00 // ......5w.^...... + 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_00006354 = bytearray ( + 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 + 05 00 00 00 06 00 00 00) +.data cil I_0000636C = bytearray ( + 00 00 00 00 00 00 F8 BF 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 F8 3F 00 00 00 00 00 00 F0 FF // .......?........ + 00 00 00 00 00 00 F0 7F 00 00 00 00 00 00 F8 FF) +.data cil I_0000639C = bytearray ( 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00) +.data cil I_000063C4 = bytearray ( + 01 00 01 00 00 00 01 01) +.data cil I_000063CC = bytearray ( + 01 00 00 00 FE FF FF FF 00 94 35 77 04 00 00 00 // ..........5w.... + 05 00 00 00 FA FF FF FF 07 00 00 00 08 00 00 00 + 09 00 00 00 0A 00 00 00) +.data cil I_000063F4 = bytearray ( + 00 00 C0 BF 00 00 00 00 00 00 C0 3F 00 00 80 FF // ...........?.... + 00 00 80 7F 00 00 C0 FF) // *********** DISASSEMBLY COMPLETE ***********************