更新:2007 年 11 月
错误消息
关键字“void”不能用于此上下文中
编译器检测到无效的 void 关键字使用。
下面的示例生成 CS1547:
// CS1547.cs
public class MyClass
{
void BadMethod()
{
void i; // CS1547, cannot have variables of type void
}
public static void Main()
{
}
}