Edit

Share via


Compiler Error CS0695

'generic type' cannot implement both 'generic interface' and 'generic interface' because they may unify for some type parameter substitutions

This error occurs when a generic class implements more than one parameterization of the same generic interface, and there exists a type parameter substitution which would make the two interfaces identical. To avoid this error, implement only one of the interfaces, or change the type parameters to avoid the conflict.

The following sample generates CS0695:

// CS0695.cs  
// compile with: /target:library  
  
interface I<T>  
{  
}  
  
class G<T1, T2> : I<T1>, I<T2>  // CS0695  
{  
}