更新:2007 年 11 月
错误消息
空的 switch 块编译器检测到了没有 case 或 default 语句的
下面的示例生成 CS1522:
// CS1522.cs
// compile with: /W:1
using System;
class x
{
public static void Main()
{
int i = 6;
switch(i) // CS1522
{
// add something to the switch block, for example:
/*
case (5):
Console.WriteLine("5");
return;
default:
Console.WriteLine("not 5");
return;
*/
}
}
} | |