linux-packaging-mono/mcs/tests/test-anon-97.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

39 lines
686 B
C#

//
// This is a build test: checks that the compiler does not loop
// forever endlessly with anonymous methods
//
using System;
using System.Collections;
using System.Text;
class Space
{ public int Value = -1;
public delegate void DoCopy();
public DoCopy CopyIt;
public void Leak(bool useArray, int max)
{ DoCopy one;
{ int answer = 0;
int[] work;
CopyIt = delegate { Value = answer; };
one = delegate
{ work = new int[max];
foreach(int x in work) answer += x;
};
}
one();
}
}
class Program
{
public static void Main(string[] args)
{
}
}