diff options
author | Ben Maurer <benm@mono-cvs.ximian.com> | 2003-12-31 20:43:54 +0300 |
---|---|---|
committer | Ben Maurer <benm@mono-cvs.ximian.com> | 2003-12-31 20:43:54 +0300 |
commit | c9b3bfce35c37ee53dd6f6bec21dc36cbb429696 (patch) | |
tree | bbdb66983f5db6d1f8d860250a8718d9b9af9c2a /mcs/errors/cs0121-2.cs | |
parent | 6bca4e9a7089abfe4593e6580d44e7f486e4b6de (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.cs | 31 |
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 |