2010-05-31 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-209.cs
blob4fe9b8d5e00ff1392d61b5bde161d44e4f5d8f22
1 using System;
3 struct A
5 public readonly int i;
7 public A (int i)
9 this.i = i;
13 class X
15 int i;
17 public int Foo {
18 get {
19 return 2 * i;
22 set {
23 i = value;
27 public int this [int a] {
28 get {
29 return (int) Foo;
32 set {
33 Foo = a;
37 public string this [string a] {
38 set {
39 Console.WriteLine (a);
43 public string Bar {
44 set {
45 Console.WriteLine (value);
49 public A A {
50 get {
51 return new A (5);
54 set {
55 Console.WriteLine (value);
59 public X (int i)
61 this.i = i;
64 public static int Main ()
66 X x = new X (9);
67 int a = x.Foo = 16;
68 int b = x [8] = 32;
69 x ["Test"] = "Hello";
70 x.Bar = "World";
71 x.A = new A (9);
72 // Compilation-only test.
73 return 0;