Parameter '<parametername>' in extension method '<methodname>' defined in '<typename>' already has a matching omitted argument

A procedure call to an extension method omits an argument by position and then supplies the argument by name. For example, the following call to extension method ABC first omits an argument for parameter Y, and then supplies it by name.

<Extension()> _
Public Sub ABC(ByVal X As Integer, Optional ByVal Y As Byte = 0, _
               Optional ByVal Z As Byte = 0)
End Sub
' . . .
' Calling extension method ABC.
Dim number As Integer
' Not valid.
' number.ABC(, 4, Y:=5)

Error ID: BC36583

To correct this error

  • Supply the argument by position, or remove the comma that omits it.

See Also

Concepts

Extension Methods (Visual Basic)

Passing Arguments by Position and by Name