﻿<?xml version="1.0" encoding="utf-8"?>
<ErrorDocumentation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ErrorName>CS0121</ErrorName>
  <Examples>
    <string>// cs0121-2.cs: The call is ambiguous between the following methods or properties: `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 {}</string>
    <string>// cs0121-3.cs: The call is ambigious between `IInteger.Add (int)' and `IDouble.Add (double)'
// Line: 28

// (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)
	{
		System.Console.WriteLine ("IDouble.Add (double d)");
	}
	void IInteger.Add (int d)
	{
		System.Console.WriteLine ("IInteger.Add (int d)");
	}
	
	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
	}
}</string>
    <string>// cs0121-4.cs: The call is ambiguous between the following methods or properties: `X.Add(float, float, float)' and `X.Add(params decimal[])'
// Line: 7

class X {
	static void Add (float f1, float f2, float f3) {}
	static void Add (params decimal [] ds) {}
	public static void Main () { Add (1, 2, 3); }
}
</string>
    <string>// cs0121.cs: The call is ambiguous between the following methods or properties: `X.a(int, double)' and `X.a(double, int)'
// Line: 15

class X {
	static void a (int i, double d)
	{
	}

	static void a (double d, int i)
	{
	}

	public static void Main ()
	{
		a (0, 0);
	}
}	
</string>
  </Examples>
</ErrorDocumentation>