Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-784.cs
1 using System;
2
3 public class A
4 {
5         protected int value = 9;
6         
7         public virtual int this [int i]
8         {
9                 get { throw new NotImplementedException (); }
10                 set { this.value = i; }
11         }
12 }
13
14 public class B : A
15 {
16         public override int this [int i]
17         {
18                 get { return value; }
19         }
20 }
21
22 public class C : B
23 {
24         public override int this [int i]
25         {
26                 get { return base [i]; }
27                 set { base [i] = value; }
28         }
29
30         public static int Main ()
31         {
32                 var c = new C ();
33                 var r = c [100]++;
34                 Console.WriteLine (r);
35                 if (r != 9)
36                         return 1;
37                         
38                 return 0;
39         }
40 }