remove executable bit from {errors,tests}/*.cs
[mono.git] / mcs / tests / test-anon-76.cs
1 using System;\r
2 \r
3 delegate object FactoryDelegate ();\r
4 \r
5 public class C\r
6 {\r
7         FactoryDelegate var;\r
8         int counter;\r
9 \r
10         FactoryDelegate this [string s]\r
11         {\r
12                 set { var = value; }\r
13                 get { return var; }\r
14         }\r
15 \r
16         public void X ()\r
17         {\r
18                 this ["ABC"] = delegate () {\r
19                         ++counter;\r
20                         Console.WriteLine ("A");\r
21                         return "Return";\r
22                 };\r
23         }\r
24 \r
25         static int Main ()\r
26         {\r
27                 C o = new C ();\r
28                 o.X ();\r
29 \r
30                 Console.WriteLine ("B");\r
31                 Console.WriteLine (o ["ABC"] ());\r
32                 \r
33                                 Console.WriteLine (o.counter);\r
34                 if (o.counter != 1)\r
35                         return 1;\r
36 \r
37                 return 0;\r
38         }\r
39 }\r