Fix bug #566087.
[mcs.git] / tests / test-480.cs
blobc594439cc23179dc7439596aaf022f97ba4a8dd4
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 static void Main(string[] args)