Share via


컴파일러 오류 CS0609

업데이트: 2007년 11월

오류 메시지

override로 표시된 인덱서에는 IndexerName 특성을 설정할 수 없습니다.
Cannot set the IndexerName attribute on an indexer marked override

override인 인덱싱된 속성에는 이름 특성(IndexerNameAttribute)을 적용할 수 없습니다. 자세한 내용은 인덱서를 참조하십시오.

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

// CS0609.cs
using System;
using System.Runtime.CompilerServices;

public class idx
{
   public virtual int this[int iPropIndex]
   {
      get
      {
         return 0;
      }
      set
      {
      }
   }
}

public class MonthDays : idx
{
   [IndexerName("MonthInfoIndexer")]   // CS0609, delete to resolve this CS0609
   public override int this[int iPropIndex]
   {
      get
      {
         return 0;
      }
      set
      {
      }
   }
}

public class test
{
   public static void Main( string[] args )
   {
   }
}