Share via


컴파일러 오류 CS1067

'type'의 partial 선언에는 동일한 순서로 동일한 형식 매개 변수 이름과 가변성(variance) 한정자가 있어야 합니다.

제네릭 부분 인터페이스의 선언을 정의하고 구현하는 경우 선언 정의와 구현 사이에서 동일한 순서로 형식 매개 변수 및 변형 수정자를 포함하여 시그니처가 일치해야 합니다.

예시

다음 샘플은 CS1067을 생성합니다.

// CS1067: type parameter 'T' has an extra 'out' modifier
public partial interface IExample1<out T>;
public partial interface IExample1<T>
{ }

// CS1067: type parameter 'T' differs in variance modifier
public partial interface IExample2<in T>;
public partial interface IExample2<out T>
{ }

// CS1067: type parameters 'T' and 'S' differs in their order
public partial interface IExample3<in S, out T>;
public partial interface IExample3<out T, in S>
{ }

이 오류를 해결하려면

제네릭 부분 인터페이스의 선언을 정의하고 구현하는 데 동일한 서명을 유지합니다.

public partial interface IExample1<T>;
public partial interface IExample1<T>
{ }

public partial interface IExample2<out T>;
public partial interface IExample2<out T>
{ }

public partial interface IExample3<out T, in S>;
public partial interface IExample3<out T, in S>
{ }

참고 항목