update readme (#21797)
[mono-project.git] / mcs / tests / test-anon-97.cs
blob62d0a6921b3e48b386f4a74d0cb9f71b35b98156
1 //
2 // This is a build test: checks that the compiler does not loop
3 // forever endlessly with anonymous methods
4 //
5 using System;
6 using System.Collections;
7 using System.Text;
9 class Space
10 { public int Value = -1;
12 public delegate void DoCopy();
14 public DoCopy CopyIt;
16 public void Leak(bool useArray, int max)
17 { DoCopy one;
19 { int answer = 0;
20 int[] work;
22 CopyIt = delegate { Value = answer; };
23 one = delegate
24 { work = new int[max];
25 foreach(int x in work) answer += x;
29 one();
33 class Program
35 public static void Main(string[] args)