編譯器警告 (層級 2) CS0467
更新:2007 年 11 月
錯誤訊息
方法 'method' 和非方法 'non-method' 之間模稜兩可。使用方法群組。
不同介面中使用相同簽章之繼承的成員造成模稜兩可錯誤。
範例
下列範例會產生 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()
{
}
}