diff --git a/ICSharpCode.Decompiler/Tests/CorrectnessTestRunner.cs b/ICSharpCode.Decompiler/Tests/CorrectnessTestRunner.cs
index 88924cb01..ba9db8696 100644
--- a/ICSharpCode.Decompiler/Tests/CorrectnessTestRunner.cs
+++ b/ICSharpCode.Decompiler/Tests/CorrectnessTestRunner.cs
@@ -156,6 +156,12 @@ namespace ICSharpCode.Decompiler.Tests
RunCS(options: options);
}
+ [Test]
+ public void Capturing([ValueSource("defaultOptions")] CompilerOptions options)
+ {
+ RunCS(options: options);
+ }
+
void RunCS([CallerMemberName] string testName = null, CompilerOptions options = CompilerOptions.UseDebug)
{
string testFileName = testName + ".cs";
diff --git a/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj
index c9e5cd4ff..744d56f33 100644
--- a/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj
+++ b/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj
@@ -126,6 +126,7 @@
+
diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Capturing.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Capturing.cs
new file mode 100644
index 000000000..1dc1e15de
--- /dev/null
+++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Capturing.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
+{
+ class Capturing
+ {
+ static void Main(string[] args)
+ {
+ TestCase1();
+ }
+
+ static void TestCase1()
+ {
+ Console.WriteLine("TestCase1");
+ for (int i = 0; i < 10; i++)
+ Console.WriteLine(i);
+ // i no longer declared
+ List actions = new List();
+ int max = 5;
+ string line;
+ while (ReadLine(out line, ref max)) {
+ actions.Add(() => Console.WriteLine(line));
+ }
+ // line still declared
+ line = null;
+ Console.WriteLine("----");
+ foreach (var action in actions)
+ action();
+ }
+
+ private static bool ReadLine(out string line, ref int v)
+ {
+ line = v + " line";
+ return --v > 0;
+ }
+ }
+}
diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Comparisons.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Comparisons.cs
index 271f483ae..48277108e 100644
--- a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Comparisons.cs
+++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Comparisons.cs
@@ -20,7 +20,7 @@ using System;
#pragma warning disable 652
-namespace ICSharpCode.Decompiler.Tests.TestCases
+namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
public class Comparisons
{
diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/CompoundAssignment.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/CompoundAssignment.cs
index f874f1590..246d45af0 100644
--- a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/CompoundAssignment.cs
+++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/CompoundAssignment.cs
@@ -19,74 +19,79 @@
using System;
using System.Collections.Generic;
-class CompoundAssignment
+namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
- static void Main()
+ class CompoundAssignment
{
- PreIncrementProperty();
- }
-
- static void Test(int a, int b)
- {
- Console.WriteLine("{0} {1}", a, b);
- }
-
- static int x;
-
- static int X()
- {
- Console.Write("X ");
- return ++x;
- }
-
- int instanceField;
-
- public int InstanceProperty {
- get {
- Console.WriteLine("In get_InstanceProperty");
- return instanceField;
+ static void Main()
+ {
+ PreIncrementProperty();
}
- set {
- Console.WriteLine("In set_InstanceProperty, value=" + value);
- instanceField = value;
+
+ static void Test(int a, int b)
+ {
+ Console.WriteLine("{0} {1}", a, b);
}
- }
-
- static int staticField;
-
- public static int StaticProperty {
- get {
- Console.WriteLine("In get_StaticProperty");
- return staticField;
+
+ static int x;
+
+ static int X()
+ {
+ Console.Write("X ");
+ return ++x;
}
- set {
- Console.WriteLine("In set_StaticProperty, value=" + value);
- staticField = value;
+
+ int instanceField;
+
+ public int InstanceProperty
+ {
+ get {
+ Console.WriteLine("In get_InstanceProperty");
+ return instanceField;
+ }
+ set {
+ Console.WriteLine("In set_InstanceProperty, value=" + value);
+ instanceField = value;
+ }
+ }
+
+ static int staticField;
+
+ public static int StaticProperty
+ {
+ get {
+ Console.WriteLine("In get_StaticProperty");
+ return staticField;
+ }
+ set {
+ Console.WriteLine("In set_StaticProperty, value=" + value);
+ staticField = value;
+ }
+ }
+
+ public static Dictionary GetDict()
+ {
+ Console.WriteLine("In GetDict()");
+ return new Dictionary();
+ }
+
+ static string GetString()
+ {
+ Console.WriteLine("In GetString()");
+ return "the string";
+ }
+
+ static void PreIncrementProperty()
+ {
+ Console.WriteLine("PreIncrementProperty:");
+ Test(X(), ++new CompoundAssignment().InstanceProperty);
+ Test(X(), ++StaticProperty);
+ }
+
+ static void PreIncrementIndexer()
+ {
+ Console.WriteLine("PreIncrementIndexer:");
+ Test(X(), ++GetDict()[GetString()]);
}
}
-
- public static Dictionary GetDict()
- {
- Console.WriteLine("In GetDict()");
- return new Dictionary();
- }
-
- static string GetString()
- {
- Console.WriteLine("In GetString()");
- return "the string";
- }
-
- static void PreIncrementProperty()
- {
- Console.WriteLine("PreIncrementProperty:");
- Test(X(), ++new CompoundAssignment().InstanceProperty);
- Test(X(), ++StaticProperty);
- }
-
- static void PreIncrementIndexer()
- {
- Console.WriteLine("PreIncrementIndexer:");
- Test(X(), ++GetDict()[GetString()]);
- }
-}
+}
\ No newline at end of file
diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ConditionalAttr.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ConditionalAttr.cs
index 873116fca..611814c16 100644
--- a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ConditionalAttr.cs
+++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ConditionalAttr.cs
@@ -5,7 +5,6 @@ using System.Diagnostics;
namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
-
class ConditionalAttr
{
[Conditional("PRINT")]
diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ControlFlow.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ControlFlow.cs
index c2b77e7b9..5d75fbb79 100644
--- a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ControlFlow.cs
+++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ControlFlow.cs
@@ -18,88 +18,91 @@
using System;
-class ControlFlow
+namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
- public static int Main()
+ class ControlFlow
{
- int result = 0;
- EmptyIf("Empty", ref result);
- EmptyIf("test", ref result);
- NormalIf("none", ref result);
- NormalIf("test", ref result);
- NormalIf2("none", ref result);
- NormalIf2("test", ref result);
- NormalIf3("none", ref result);
- NormalIf3("test", ref result);
- Test("none", ref result);
- Test("test", ref result);
- Console.WriteLine(result);
- return 0;
- }
-
- static void EmptyIf(string input, ref int result)
- {
- if (input.Contains("test")) {
+ public static int Main()
+ {
+ int result = 0;
+ EmptyIf("Empty", ref result);
+ EmptyIf("test", ref result);
+ NormalIf("none", ref result);
+ NormalIf("test", ref result);
+ NormalIf2("none", ref result);
+ NormalIf2("test", ref result);
+ NormalIf3("none", ref result);
+ NormalIf3("test", ref result);
+ Test("none", ref result);
+ Test("test", ref result);
+ Console.WriteLine(result);
+ return 0;
}
- result = result + 1;
- Console.WriteLine("EmptyIf");
- }
- static void NormalIf(string input, ref int result)
- {
- if (input.Contains("test")) {
- Console.WriteLine("result");
- } else {
- Console.WriteLine("else");
+ static void EmptyIf(string input, ref int result)
+ {
+ if (input.Contains("test")) {
+ }
+ result = result + 1;
+ Console.WriteLine("EmptyIf");
}
- result = result + 1;
- Console.WriteLine("end");
- }
- static void NormalIf2(string input, ref int result)
- {
- if (input.Contains("test")) {
- Console.WriteLine("result");
+ static void NormalIf(string input, ref int result)
+ {
+ if (input.Contains("test")) {
+ Console.WriteLine("result");
+ } else {
+ Console.WriteLine("else");
+ }
+ result = result + 1;
+ Console.WriteLine("end");
}
- result = result + 1;
- Console.WriteLine("end");
- }
- static void NormalIf3(string input, ref int result)
- {
- if (input.Contains("test")) {
- Console.WriteLine("result");
- } else {
- Console.WriteLine("else");
+ static void NormalIf2(string input, ref int result)
+ {
+ if (input.Contains("test")) {
+ Console.WriteLine("result");
+ }
+ result = result + 1;
+ Console.WriteLine("end");
}
- result = result + 1;
- }
- static void Test(string input, ref int result)
- {
- foreach (char c in input) {
- Console.Write(c);
+ static void NormalIf3(string input, ref int result)
+ {
+ if (input.Contains("test")) {
+ Console.WriteLine("result");
+ } else {
+ Console.WriteLine("else");
+ }
result = result + 1;
}
- if (input.Contains("test")) {
- Console.WriteLine("result");
- } else {
- Console.WriteLine("else");
+
+ static void Test(string input, ref int result)
+ {
+ foreach (char c in input) {
+ Console.Write(c);
+ result = result + 1;
+ }
+ if (input.Contains("test")) {
+ Console.WriteLine("result");
+ } else {
+ Console.WriteLine("else");
+ }
}
- }
- int Dim2Search(int arg)
- {
- var tens = new[] { 10, 20, 30 };
- var ones = new[] { 1, 2, 3 };
+ int Dim2Search(int arg)
+ {
+ var tens = new[] { 10, 20, 30 };
+ var ones = new[] { 1, 2, 3 };
- for (int i = 0; i < tens.Length; i++) {
- for (int j = 0; j < ones.Length; j++) {
- if (tens[i] + ones[j] == arg)
- return i;
+ for (int i = 0; i < tens.Length; i++) {
+ for (int j = 0; j < ones.Length; j++) {
+ if (tens[i] + ones[j] == arg)
+ return i;
+ }
}
- }
- return -1;
+ return -1;
+ }
}
-}
+}
\ No newline at end of file
diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Conversions.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Conversions.cs
index 0771ae32a..b808aee34 100644
--- a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Conversions.cs
+++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Conversions.cs
@@ -21,7 +21,7 @@
using System;
using ICSharpCode.Decompiler.Util;
-namespace ICSharpCode.Decompiler.Tests.TestCases
+namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
public class Conversions
{
diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/DecimalFields.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/DecimalFields.cs
index b683fffa1..6a2d57816 100644
--- a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/DecimalFields.cs
+++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/DecimalFields.cs
@@ -18,7 +18,7 @@
using System;
-namespace ICSharpCode.Decompiler.Tests.TestCases
+namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
///
/// Description of DecimalFields.
diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Generics.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Generics.cs
index cb251deca..61d4d4875 100644
--- a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Generics.cs
+++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/Generics.cs
@@ -18,7 +18,7 @@
using System;
-namespace Generics
+namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
///
/// Description of Generics.
diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/HelloWorld.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/HelloWorld.cs
index c313e85a4..277b73ec6 100644
--- a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/HelloWorld.cs
+++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/HelloWorld.cs
@@ -18,7 +18,7 @@
using System;
-namespace HelloWorld
+namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
class HelloWorld
{
diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/InitializerTests.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/InitializerTests.cs
index 038bda3e6..1b88f7b54 100644
--- a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/InitializerTests.cs
+++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/InitializerTests.cs
@@ -19,192 +19,194 @@
using System;
using System.Collections.Generic;
-public class InitializerTests
+namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
- public static int Main()
+ public class InitializerTests
{
- int[,] test = new int[2,3];
- test[0,0] = 0;
- test[0,1] = 1;
- test[0,2] = 2;
- int result = test.Length + test[0, 0] + test[0, 2];
- Console.WriteLine(result);
- return 0;
- }
-
- private enum MyEnum
- {
- a,
- b
- }
-
- private enum MyEnum2
- {
- c,
- d
- }
-
- private class Data
- {
- public List FieldList = new List();
- public InitializerTests.MyEnum a
+ public static int Main()
{
- get;
- set;
+ int[,] test = new int[2, 3];
+ test[0, 0] = 0;
+ test[0, 1] = 1;
+ test[0, 2] = 2;
+ int result = test.Length + test[0, 0] + test[0, 2];
+ Console.WriteLine(result);
+ return 0;
}
- public List PropertyList
+
+ private enum MyEnum
{
- get;
- set;
+ a,
+ b
}
- public InitializerTests.Data MoreData
+ private enum MyEnum2
{
- get;
- set;
+ c,
+ d
}
-
- public InitializerTests.StructData NestedStruct
+
+ private class Data
{
- get;
- set;
+ public List FieldList = new List();
+ public InitializerTests.MyEnum a
+ {
+ get;
+ set;
+ }
+ public List PropertyList
+ {
+ get;
+ set;
+ }
+
+ public InitializerTests.Data MoreData
+ {
+ get;
+ set;
+ }
+
+ public InitializerTests.StructData NestedStruct
+ {
+ get;
+ set;
+ }
}
- }
-
- private struct StructData
- {
- public int Field;
- public int Property
+
+ private struct StructData
{
- get;
- set;
+ public int Field;
+ public int Property
+ {
+ get;
+ set;
+ }
+
+ public InitializerTests.Data MoreData
+ {
+ get;
+ set;
+ }
+
+ public StructData(int initialValue)
+ {
+ this = default(InitializerTests.StructData);
+ this.Field = initialValue;
+ this.Property = initialValue;
+ }
}
-
- public InitializerTests.Data MoreData
+
+ // Helper methods used to ensure initializers used within expressions work correctly
+ private static void X(object a, object b)
{
- get;
- set;
}
-
- public StructData(int initialValue)
+
+ private static object Y()
{
- this = default(InitializerTests.StructData);
- this.Field = initialValue;
- this.Property = initialValue;
+ return null;
}
- }
-
- // Helper methods used to ensure initializers used within expressions work correctly
- private static void X(object a, object b)
- {
- }
-
- private static object Y()
- {
- return null;
- }
- #region Array Initializers
- public static void Array1()
- {
- InitializerTests.X(InitializerTests.Y(), new int[]
- {
+ #region Array Initializers
+ public static void Array1()
+ {
+ InitializerTests.X(InitializerTests.Y(), new int[]
+ {
1,
2,
3,
- 4,
+ 4,
5,
6,
7,
8,
9,
10
- });
- }
+ });
+ }
- public static void Array2(int a, int b, int c)
- {
- InitializerTests.X(InitializerTests.Y(), new int[]
- {
+ public static void Array2(int a, int b, int c)
+ {
+ InitializerTests.X(InitializerTests.Y(), new int[]
+ {
a,
0,
- b,
- 0,
+ b,
+ 0,
c
- });
- }
+ });
+ }
- public static void NestedArray(int a, int b, int c)
- {
- InitializerTests.X(InitializerTests.Y(), new int[][]
+ public static void NestedArray(int a, int b, int c)
{
+ InitializerTests.X(InitializerTests.Y(), new int[][]
+ {
new int[]
{
- 1,
+ 1,
2,
- 3,
+ 3,
4,
- 5,
- 6,
- 7,
+ 5,
+ 6,
+ 7,
8,
- 9,
+ 9,
10
},
new int[]
{
- a,
+ a,
b,
c
},
new int[]
{
1,
- 2,
+ 2,
3,
- 4,
- 5,
+ 4,
+ 5,
6
}
- });
- }
+ });
+ }
- public static void ArrayBoolean()
- {
- InitializerTests.X(InitializerTests.Y(), new bool[]
- {
+ public static void ArrayBoolean()
+ {
+ InitializerTests.X(InitializerTests.Y(), new bool[]
+ {
+ true,
+ false,
+ true,
+ false,
+ false,
+ false,
true,
- false,
- true,
- false,
- false,
- false,
- true,
true
- });
- }
+ });
+ }
- public static void ArrayByte()
- {
- InitializerTests.X(InitializerTests.Y(), new byte[]
- {
+ public static void ArrayByte()
+ {
+ InitializerTests.X(InitializerTests.Y(), new byte[]
+ {
1,
2,
- 3,
- 4,
- 5,
+ 3,
+ 4,
+ 5,
6,
7,
8,
254,
255
- });
- }
+ });
+ }
- public static void ArraySByte()
- {
- InitializerTests.X(InitializerTests.Y(), new sbyte[]
- {
+ public static void ArraySByte()
+ {
+ InitializerTests.X(InitializerTests.Y(), new sbyte[]
+ {
-128,
-127,
0,
@@ -213,55 +215,55 @@ public class InitializerTests
3,
4,
127
- });
- }
+ });
+ }
- public static void ArrayShort()
- {
- InitializerTests.X(InitializerTests.Y(), new short[]
- {
+ 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[]
- {
+ public static void ArrayUShort()
+ {
+ InitializerTests.X(InitializerTests.Y(), new ushort[]
+ {
0,
1,
32767,
- 32768,
+ 32768,
65534,
65535
- });
- }
+ });
+ }
- public static void ArrayInt()
- {
- InitializerTests.X(InitializerTests.Y(), new int[]
- {
+ public static void ArrayInt()
+ {
+ InitializerTests.X(InitializerTests.Y(), new int[]
+ {
1,
-2,
2000000000,
- 4,
+ 4,
5,
-6,
7,
8,
- 9,
+ 9,
10
- });
- }
+ });
+ }
- public static void ArrayUInt()
- {
- InitializerTests.X(InitializerTests.Y(), new uint[]
- {
+ public static void ArrayUInt()
+ {
+ InitializerTests.X(InitializerTests.Y(), new uint[]
+ {
1u,
2000000000u,
3000000000u,
@@ -272,25 +274,25 @@ public class InitializerTests
8u,
9u,
10u
- });
- }
+ });
+ }
- public static void ArrayLong()
- {
- InitializerTests.X(InitializerTests.Y(), new long[]
- {
+ 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[]
- {
+ public static void ArrayULong()
+ {
+ InitializerTests.X(InitializerTests.Y(), new ulong[]
+ {
1uL,
2000000000uL,
3000000000uL,
@@ -301,100 +303,100 @@ public class InitializerTests
8uL,
4999999999999999999uL,
9999999999999999999uL
- });
- }
+ });
+ }
- public static void ArrayFloat()
- {
- InitializerTests.X(InitializerTests.Y(), new float[]
- {
+ 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[]
- {
+ 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[]
- {
+ public static void ArrayDecimal()
+ {
+ InitializerTests.X(InitializerTests.Y(), new decimal[]
+ {
-100m,
0m,
100m,
- -79228162514264337593543950335m,
- 79228162514264337593543950335m,
+ -79228162514264337593543950335m,
+ 79228162514264337593543950335m,
0.0000001m
- });
- }
+ });
+ }
- public static void ArrayString()
- {
- InitializerTests.X(InitializerTests.Y(), new string[]
- {
+ public static void ArrayString()
+ {
+ InitializerTests.X(InitializerTests.Y(), new string[]
+ {
"",
null,
"Hello",
"World"
- });
- }
+ });
+ }
- public static void ArrayEnum()
- {
- InitializerTests.X(InitializerTests.Y(), new InitializerTests.MyEnum[]
- {
+ 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()
- {
- InitializerTests.X(InitializerTests.Y(), new List
+ 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()
+ {
+ InitializerTests.X(InitializerTests.Y(), new List
{
1,
2,
3
});
- }
+ }
- public static object RecursiveCollectionInitializer()
- {
- List