Udostępnij za pośrednictwem


Member '<classname>.<procedurename>' that matches this signature cannot be overridden because the class '<classname>' contains multiple members with this same name and signature: <signaturelist>

A procedure or property attempts to override an inherited procedure or property, but the compiler finds more than one version of the base procedure or property with the same name and signature.

This error can occur in a situation with constructed generic types, as the following skeleton declarations illustrate.

Public Class baseClass(Of t)
    Public Overridable Sub doSomething(ByVal inputValue As String)
    End Sub
    Public Overridable Sub doSomething(ByVal inputValue As t)
    End Sub
End Class
Public Class derivedClass
    Inherits baseClass(Of String)
    Overrides Sub doSomething(ByVal inputValue As String)
    End Sub
End Class

Because derivedClass inherits baseClass supplying String to its type parameter t, the two versions of doSomething in baseClass take on identical signatures as far as derivedClass is concerned. As a result, the compiler cannot determine which version to override.

Error ID: BC30935

To correct this error

  • Change the type argument or arguments you supply to the base class so that it does not result in one or more identical signatures of member procedures or properties.

    -or-

  • If you need to inherit the base class with the set of type arguments you are using, then do not override the procedure or property cited in this error message.

See Also

Concepts

Overriding Properties and Methods

Reference

Overridable

Overrides