Edit

Share via


Type parameter not allowed in 'Implements' clause

An Implements clause in a generic type specifies a type parameter as the member to be implemented.

An Implements clause must specify an interface and a member. It can pass a type parameter to the interface, but it cannot pass it to the member, nor use it as the name of the member.

The following statements can generate this error.

VB
Class c1(Of t)  
    Implements i1(Of t)  
    Public Sub doSomething() Implements t  
End Class  

Error ID: BC32056

To correct this error

  • Specify the interface name and a genuine member of the interface following the Implements keyword. You can pass the type parameter to the interface if appropriate.

    VB
    Public Sub doSomething() Implements i1(Of t).doSomething  
    

See also