Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Duplicate constraint 'constraint' for type parameter 'type parameter'
Two of the constraints on the generic declaration are identical. To get rid of the error, remove the duplicate.
The following sample generates CS0405:
// CS0405.cs
interface I
{
}
class C<T> where T : I, I // CS0405.cs
{
}
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.