Share via


컴파일러 오류 CS0307

업데이트: 2007년 11월

오류 메시지

'construct' 'identifier'은(는) 제네릭 메서드가 아닙니다. 식 목록을 사용하려면 < 식 주위에 괄호를 사용하십시오.
The 'construct' 'identifier' is not a generic method. If you intended an expression list, use parentheses around the < expression.

지정된 구문은 제네릭 인수를 받을 수 있는 유일한 구문인 형식 또는 메서드가 아닙니다. 꺾쇠괄호에서 형식 인수를 제거합니다. 제네릭이 필요한 경우 제네릭 구문을 제네릭 형식 또는 메서드로 선언합니다.

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

// CS0307.cs
class C
{
   public int P { get { return 1; } }
   public static void Main()
   {
      C c = new C();
      int p = c.P<int>();  // CS0307 – C.P is a property
      // Try this instead
      // int p = c.P;
   }
}