编译器错误 CS1001
更新:2007 年 11 月
错误消息
应输入标识符
未提供标识符。例如,当声明枚举时,必须指定成员。
下面的示例生成 CS1001:
// CS1001.cs
public class clx
{
enum splitch : int
{
'a', 'b' // CS1001, 'a' is not a valid int identifier
};
public static void Main()
{
}
}
即使编译器不使用参数名(例如,在接口定义中),也需要参数名。需要这些参数,以便使用接口的程序员能够对参数的含义有所了解。
// CS1001-2.cs
// compile with: /target:library
interface IMyTest
{
void TestFunc1(int, int); // CS1001
}
class CMyTest : IMyTest
{
void IMyTest.TestFunc1(int a, int b)
{
}
}