Compiler Error CS1067

Partial declarations of 'type' must have the same type parameter names and variance modifiers in the same order.

Both defining and implementing declaration of a generic partial interface must have their signatures matching including the type parameters and variance modifers in the same order between defining and implementing declaration.

Example

The following samples generate 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>
{ }

To correct this error

Keep the same signatures for both defining and implementing declaration of a generic partial interface:

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>
{ }

See also