2 // Tests different anonymous method caching scenarios
5 public delegate void StringSender (string str);
6 public delegate void VoidDelegate ();
10 public static void Main()
12 MainClass mc = new MainClass ();
13 VoidDelegate del = new VoidDelegate (
15 StringSender ss = delegate (string s) {
16 SimpleCallback(mc, s);
31 StringSender d = delegate (string s) {
32 VoidDelegate d2 = delegate {
41 VoidDelegate d = delegate () { u = 9; };
42 VoidDelegate d2 = delegate () { };
47 VoidDelegate d = delegate () {
48 VoidDelegate d2 = delegate () {
50 VoidDelegate d3 = delegate () {
51 VoidDelegate d4 = delegate () {
62 delegate int D (int a);
66 D d2 = delegate (int i) {
67 D d1 = delegate (int a) {
75 static void SimpleCallback (MainClass mc, string str)
77 System.Console.WriteLine(str);