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:
authorBen Maurer <benm@mono-cvs.ximian.com>2003-12-31 20:43:54 +0300
committerBen Maurer <benm@mono-cvs.ximian.com>2003-12-31 20:43:54 +0300
commitc9b3bfce35c37ee53dd6f6bec21dc36cbb429696 (patch)
treebbdb66983f5db6d1f8d860250a8718d9b9af9c2a /mcs/errors/cs0121-2.cs
parent6bca4e9a7089abfe4593e6580d44e7f486e4b6de (diff)
We fail on this variation of CS0121, where an interface has two identical methods from base interfaces, leaving an ambigious call
svn path=/trunk/mcs/; revision=21571
Diffstat (limited to 'mcs/errors/cs0121-2.cs')
-rw-r--r--mcs/errors/cs0121-2.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/mcs/errors/cs0121-2.cs b/mcs/errors/cs0121-2.cs
new file mode 100644
index 00000000000..3adea7a8f27
--- /dev/null
+++ b/mcs/errors/cs0121-2.cs
@@ -0,0 +1,31 @@
+// cs0121-2.cs: ambigous call selecting between `IFoo.DoIt ()' and `IBar.DoIt ()'
+// Line: 9
+
+class A : IFooBar {
+ static void Main ()
+ {
+ A a = new A ();
+ IFooBar fb = (IFooBar) a;
+ fb.DoIt ();
+ }
+
+ void IFoo.DoIt ()
+ {
+ System.Console.WriteLine ("void IFoo.DoIt ()");
+ }
+
+ void IBar.DoIt ()
+ {
+ System.Console.WriteLine ("void IBar.DoIt ()");
+ }
+}
+
+interface IFoo {
+ void DoIt ();
+}
+
+interface IBar {
+ void DoIt ();
+}
+
+interface IFooBar : IFoo, IBar {} \ No newline at end of file