컴파일러 오류 CS0761
업데이트: 2007년 11월
오류 메시지
'method<T>'의 부분 메서드(Partial Method) 선언에 일관성이 없는 형식 매개 변수 제약 조건이 있습니다.
Partial method declarations of 'method<T>' have inconsistent type parameter constraints.
부분 메서드에 구현이 있는 경우 제네릭 형식 제약 조건은 메서드 시그니처에 정의된 제약 조건과 같아야 합니다.
이 오류를 해결하려면
- 제네릭 형식 제약 조건을 부분 메서드의 각 부분에서 동일하게 만듭니다.
예제
다음 코드에서는 CS0761 오류가 발생하는 경우를 보여 줍니다.
// cs0761.cs
using System;
public partial class C
{
partial void Part<T>() where T : class;
partial void Part<T>() where T : struct // CS0761
{
}
public static int Main()
{
return 1;
}
}