Edit

Share via


<type1> '<membername>' shadows an overloadable member declared in the base <type2> '<classname>'

<type1> '<membername>' shadows an overloadable member declared in the base <type2> '<classname>. If you want to overload the base method, this method must be declared 'Overloads'.

A derived class defines a Function or Sub procedure or a Property with the same name as a procedure or property defined in the base class. Because procedures and properties are overloadable members, the derived class can either overload or shadow the base class member. However, the derived class code does not specify either Overloads or Shadows in the declaration. In the absence of either keyword, the compiler assumes Shadows.

It is good programming practice to specify either Overloads or Shadows. This makes your code easier to read and understand.

By default, this message is a warning. For more information about hiding warnings or treating warnings as errors, see Configuring Warnings in Visual Basic.

Error ID: BC40003

To correct this error

  • If you want to overload the base class method or property, include the Overloads keyword in the declaration.

  • If you want to shadow the base class method or property, include the Shadows keyword instead of Overloads.

  • If you do not want to either overload or shadow the base class member, change the name of the derived class member.

See also