2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mcs / tests / test-named-01.cs
1 // Compiler options: -langversion:future
2
3 using System;
4
5 class A
6 {
7         public int Index;
8         
9         public A ()
10                 : this (x : 0)
11         {
12         }
13         
14         protected A (object x)
15         {
16         }
17         
18         public virtual int this [int i] {
19                 set {
20                         Index = value;
21                 }
22         }
23 }
24
25 class B : A
26 {
27         public B ()
28                 : base (x : "x")
29         {
30         }
31         
32         public override int this [int i] {
33                 set {
34                         base [i : i] = value + 4;
35                 }
36         }
37 }
38
39 class XAttribute:Attribute
40 {
41         public XAttribute (int h)
42         {
43         }
44 }
45
46 [X (h : 3)]
47 class M
48 {
49         static void Foo (int a)
50         {
51         }
52         
53         public static int Main ()
54         {
55                 Foo (a : -9);
56                 
57                 B b = new B ();
58                 b [8] = 5;
59                 if (b.Index != 9)
60                         return 1;
61                 
62                 Console.WriteLine ("ok");
63                 return 0;
64         }
65 }