Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-342.cs
1 using System;
2
3 class A {
4         public virtual void Foo (int i) { }
5         
6         public virtual void Foo (double d) {
7                 throw new Exception ("Shouldn't be invoked");
8         }
9         
10         public virtual bool this [int i] {
11                 get { return true; }
12         }
13         
14         public virtual bool this [double d] {
15                 get { throw new Exception ("Shouldn't be invoked"); }
16         }
17
18 }
19
20 class B : A {
21         public override void Foo (double d) {
22                 throw new Exception ("Overload resolution failed");
23         }
24         
25         public override bool this [double d] {
26                 get { throw new Exception ("Overload resolution failed"); }
27         }
28         
29         public static void Main () {
30                 new B ().Foo (1);
31                 bool b = new B () [1];
32         }
33 }