This topic has not yet been rated - Rate this topic

Compiler Warning (level 3) CS0693

Type parameter 'type parameter' has the same name as the type parameter from outer type 'type'

This error occurs when you have a generic member such as a method inside a generic class. Since the method's type parameter is not necessarily the same as the class's type parameter, you cannot give them both the same name. For more information, see Generic Methods (C# Programming Guide).

To avoid this situation, use a different name for one of the type parameters.

The following sample generates CS0693.

// CS0693.cs
// compile with: /W:3 /target:library
class Outer<T>
{
   class Inner<T> {}   // CS0693
   // try the following line instead
   // class Inner<U> {}
}
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ