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-09-06 12:29:40 +0400
committerMarek Safar <marek.safar@gmail.com>2011-09-06 14:58:58 +0400
commitfcdafff83d2e00a048377a94bd59d4cdac4d1d0e (patch)
treeba728976a3021972f1449e9ba3bcfb9d01c36fbd /mcs/tests/test-826.cs
parent8cf9a08adc5d366f33eb6ebe4dd49fba0a966d32 (diff)
Don't set NewSlot attribute when base class already implements the interface method and same method exists in derived class
Diffstat (limited to 'mcs/tests/test-826.cs')
-rw-r--r--mcs/tests/test-826.cs55
1 files changed, 55 insertions, 0 deletions
diff --git a/mcs/tests/test-826.cs b/mcs/tests/test-826.cs
new file mode 100644
index 00000000000..bda94deda68
--- /dev/null
+++ b/mcs/tests/test-826.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Reflection;
+
+public interface I
+{
+ int Foo ();
+}
+
+public class A : I
+{
+ int I.Foo ()
+ {
+ Console.WriteLine ("a");
+ return 1;
+ }
+}
+
+public class AA : A, I
+{
+ public int Foo ()
+ {
+ Console.WriteLine ("aa");
+ return 2;
+ }
+}
+
+public class B : A
+{
+ public int Foo ()
+ {
+ Console.WriteLine ("b");
+ return 3;
+ }
+}
+
+public class Test
+{
+ public static int Main ()
+ {
+ I i = new AA ();
+ if (i.Foo () != 2)
+ return 1;
+
+ i = new B ();
+ if (i.Foo () != 1)
+ return 2;
+
+ var m = typeof (B).GetMethod ("Foo");
+ Console.WriteLine (m.Attributes);
+ if (m.Attributes != (MethodAttributes.Public | MethodAttributes.HideBySig))
+ return 3;
+
+ return 0;
+ }
+} \ No newline at end of file