Compiler Error CS0694
Type parameter 'identifier' has the same name as the containing type, or method
You must use a different name for the type parameter since the type parameter's name cannot be identical to the type or method name that contains the type parameter.
The following sample generates CS0694.
// CS0694.cs
// compile with: /target:library
class C<C> {} // CS0694
In addition to the above case involving a generic class, this error may occur with a method:
// CS0694_2.cs
// compile with: /target:library
class A
{
public void F<F>(F arg); // CS0694
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: