add bug info
[mcs.git] / tests / test-179.cs
blobe7f4efbc7117788f88fd39f5c802015fb8f92809
2 class A {
3 double d1,d2;
4 public double this[double x] {
5 set {
6 d1 = x;
7 d2 = value;
9 get {
10 if (d1 == x) {
11 return d2;
13 return 0.0;
18 class B : A {
19 double d1,d2;
20 public new double this[double x] {
21 set {
22 d1 = x;
23 d2 = value;
25 get {
26 if (d1 == x) {
27 return d2;
29 return 0.0;
34 class C : B{
35 string s1,s2;
36 int i1,i2;
37 public string this[string x] {
38 set {
39 s1 = x;
40 s2 = value;
42 get {
43 if (s1 == x) {
44 return s2;
46 return "";
49 public int this[int x] {
50 set {
51 i1 = x;
52 i2 = value;
54 get {
55 if (i1 == x) {
56 return i2;
58 return 0;
63 struct EntryPoint {
65 public static int Main (string[] args) {
66 C test = new C();
68 test[333.333] = 444.444;
69 if (test[333.333] != 444.444)
70 return 1;
72 test["a string"] = "another string";
73 if (test["a string"] != "another string")
74 return 2;
76 test[111] = 222;
77 if (test[111] != 222)
78 return 3;
80 System.Console.WriteLine ("Passes");
81 return 0;