Avviso del compilatore (livello 2) CS0467

Aggiornamento: novembre 2007

Messaggio di errore

Ambiguità tra il metodo "method" e "non-method", che non è un metodo. Verrà utilizzato il gruppo di metodi.
Ambiguity between method 'method' and non-method 'non-method'. Using method group.

L'errore di ambiguità è causato dalla presenza di membri ereditati con la stessa firma, ma da interfacce diverse.

Esempio

Nell'esempio riportato di seguito viene generato l'errore CS0467.

// CS0467.cs
interface IList 
{
int Count { get; set; }
}
interface ICounter
{
void Count(int i);
}

interface IListCounter : IList, ICounter {}

class Driver 
{
    void Test(IListCounter x)
    {
        x.Count = 1;
        x.Count(1);   // CS0467
        // To resolve change the method name "Count" to another name.
    }
    
    static void Main() 
    {
    }
}