Share via


컴파일러 오류 CS0152

업데이트: 2007년 11월

오류 메시지

이 switch 문에 이미 'label' 레이블이 있습니다.
The label 'label' already occurs in this switch statement

레이블을 switch 문에서 중복 사용했습니다. 자세한 내용은 switch(C# 참조)를 참조하십시오.

다음 샘플에서는 CS0152 오류가 발생하는 경우를 보여 줍니다.

// CS0152.cs
namespace MyNamespace
{
   public class MyClass
   {
      public static void Main()
      {
         int i = 0;

         switch (i)
         {
            case 1:
               i++;
               return;

            case 1:   // CS0152, two case 1 statements
               i++;
               return;
         }
      }
   }
}