Share via


컴파일러 오류 CS1551

업데이트: 2007년 11월

오류 메시지

인덱서에 매개 변수를 적어도 하나는 지정해야 합니다.
Indexers must have at least one parameter

인수가 없는 인덱서를 선언했습니다.

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

// CS1551.cs
public class MyClass
{
   int intI;

   int this[]   // CS1551
   // try the following line instead
   // int this[int i]
   {
      get
      {
         return intI;
      }
      set
      {
         intI = value;
      }
   }

   public static void Main()
   {
   }
}