Merge pull request #1861 from saper/home-override
[mono-project.git] / mcs / tests / test-anon-76.cs
blob10c7f38eb6716c00b40b0fe9640023ad8a278996
1 using System;
3 delegate object FactoryDelegate ();
5 public class C
7 FactoryDelegate var;
8 int counter;
10 FactoryDelegate this [string s]
12 set { var = value; }
13 get { return var; }
16 public void X ()
18 this ["ABC"] = delegate () {
19 ++counter;
20 Console.WriteLine ("A");
21 return "Return";
25 public static int Main ()
27 C o = new C ();
28 o.X ();
30 Console.WriteLine ("B");
31 Console.WriteLine (o ["ABC"] ());
33 Console.WriteLine (o.counter);
34 if (o.counter != 1)
35 return 1;
37 return 0;