Name of type parameter '<typeparametername1>' does not match '<typeparametername2>', the corresponding type parameter defined on the partial method declaration '<methodname>'

In a partial method that includes one or more type parameters, the names of the type parameters must be the same in the declaration of the method and in the implementation of the method.

For example, the following declaration and implementation cause this error.

' Definition of the partial method signature with type parameter T.
Partial Private Sub OnNameChanged(Of T)()
End Sub
'' Implementation of the partial method with type parameter N.
'Private Sub OnNameChanged(Of N)()
'    Console.WriteLine("Name was changed to " & Me.Name)
'End Sub

Error ID: BC31443

To correct this error

  • Examine the type parameters to determine where they do not match. Change the names as necessary to make them the same.

See Also

Concepts

Partial Methods

Generic Procedures in Visual Basic