Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2011-11-23 18:05:07 +0400
committerMarek Safar <marek.safar@gmail.com>2011-11-23 18:09:07 +0400
commit81bd4cf94bcd497db585aaa7478037f6cce762ae (patch)
tree018318f67898b0ff9d7412d2c8affb81a72e209c /mcs/tests/test-834.cs
parent159eee26b87dfa695f7d2a7c81c28662fa7b1dd1 (diff)
Add instance qualifier check to overload resolver. Fixes #2160
Diffstat (limited to 'mcs/tests/test-834.cs')
-rw-r--r--mcs/tests/test-834.cs63
1 files changed, 63 insertions, 0 deletions
diff --git a/mcs/tests/test-834.cs b/mcs/tests/test-834.cs
new file mode 100644
index 00000000000..97aeb505378
--- /dev/null
+++ b/mcs/tests/test-834.cs
@@ -0,0 +1,63 @@
+using System;
+
+class A
+{
+ public int Value;
+
+ public A (object o)
+ {
+ Value = 500;
+ }
+
+ protected A (int a)
+ {
+ Value = a;
+ }
+
+ public int Test (object o)
+ {
+ return 2;
+ }
+
+ protected int Test(int i)
+ {
+ return 5;
+ }
+
+ protected int this [int i] {
+ get { return i; }
+ }
+
+ public int this [object i] {
+ get {
+ return 2;
+ }
+ }
+}
+
+class B : A
+{
+ public B ()
+ : base (1)
+ {
+ }
+
+ public static int Main ()
+ {
+ int r;
+ A a = new A (1);
+ if (a.Value != 500)
+ return 1;
+
+ r = a.Test (1);
+ if (r != 2)
+ return 2;
+
+ r = a [0];
+ if (r != 2)
+ return 3;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+} \ No newline at end of file