2010-04-13 Sebastien Pouliot <sebastien@ximian.com>
[mono-project.git] / mcs / tests / test-named-01.cs
blob44484610a0b8f9af4b2fd5986083c8d9ae5fad3d
1 // Compiler options: -langversion:future
3 using System;
5 class A
7 public int Index;
9 public A ()
10 : this (x : 0)
14 protected A (object x)
18 public virtual int this [int i] {
19 set {
20 Index = value;
25 class B : A
27 public B ()
28 : base (x : "x")
32 public override int this [int i] {
33 set {
34 base [i : i] = value + 4;
39 class XAttribute:Attribute
41 public XAttribute (int h)
46 [X (h : 3)]
47 class M
49 static void Foo (int a)
53 public static int Main ()
55 Foo (a : -9);
57 B b = new B ();
58 b [8] = 5;
59 if (b.Index != 9)
60 return 1;
62 Console.WriteLine ("ok");
63 return 0;