Flush (work in progress)
[mono.git] / mcs / errors / cs0121-3.cs
index d044e204a3d31bb225ef1f0a6c1b35a67af47435..ae264ead0d4933b244cb7447e17f179c214964ae 100644 (file)
@@ -1,33 +1,23 @@
-// cs0121-3.cs: The call is ambigious between `IInteger.Add (int)' and `IDouble.Add (double)'
-// Line: 28
+// CS0121: The call is ambiguous between the following methods or properties: `A.operator +(A, B)' and `B.operator +(A, B)'
+// Line: 21
 
-// (note, this is taken from `13.2.5 Interface member access')
-interface IInteger {
-       void Add(int i);
-}
-
-interface IDouble {
-       void Add(double d);
-}
-
-interface INumber: IInteger, IDouble {}
-
-class Number : INumber {
-       void IDouble.Add (double d)
+class A
+{
+       public static A operator + (A a, B b)
        {
-               System.Console.WriteLine ("IDouble.Add (double d)");
+               return null;
        }
-       void IInteger.Add (int d)
+}
+
+class B
+{
+       public static A operator + (A a, B b)
        {
-               System.Console.WriteLine ("IInteger.Add (int d)");
+               return null;
        }
-       
+
        static void Main ()
        {
-               INumber n = new Number ();
-               n.Add(1);               // Error, both Add methods are applicable
-               n.Add(1.0);               // Ok, only IDouble.Add is applicable
-               ((IInteger)n).Add(1);   // Ok, only IInteger.Add is a candidate
-               ((IDouble)n).Add(1);      // Ok, only IDouble.Add is a candidate
+               object o = new A () + new B ();
        }
-}
\ No newline at end of file
+}