컴파일러 경고(수준 1) CS1522

업데이트: 2007년 11월

오류 메시지

빈 스위치 블록입니다.
Empty switch block

컴파일러에서 case 또는 default 문이 없는 switch 블록을 발견했습니다. 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;
         */
      }
   }
}