Delen via


Member '<membername1>' implicitly declares '<implicitmembername>', which conflicts with a member implicitly declared for member '<membername2>' in the base class '<baseclassname>'

Member '<membername1>' implicitly declares '<implicitmembername>', which conflicts with a member implicitly declared for member '<membername2>' in the base class '<baseclassname>'. So the member should be declared 'Shadows'.

A member of a derived class generates an implicit member with the same name as an implicit member of the base class. Because implicit members do not specify Overloads, the compiler assumes that this member Shadows the implicit base class member. Your code is more readable, and less prone to error, if you explicitly specify the Shadows keyword for this member.

The Visual Basic compiler creates implicit members corresponding to certain programming elements you declare. The following table summarizes these implicit, or synthetic, members.

Declared element

Implicitly created members

Enumeration

value__ member

Event

add_<eventname> procedure

remove_<eventname> procedure

<eventname>Event field

<eventname>EventHandler delegate

Property

get_<propertyname> procedure

set_<propertyname> procedure

My.Form member, My.WebService member, or member of a class marked with the MyGroupCollectionAttribute attribute

m_<variablename>Static variable

<variablename> property

get_<variablename> procedure

set_<variablename> procedure

WithEvents variable

_<variablename> variable

<variablename> property

get_<variablename> procedure

set_<variablename> procedure

Because of the risk of name conflicts, you should avoid naming any declared programming element using the same form as any one of these implicit members. For example, you should avoid any element name that starts with get_ or set_.

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: BC40018

To correct this error

  • If you intend to hide, or shadow, the implicit base class member, include the Shadows keyword in the declaration of the derived class member.

  • If you do not intend to shadow the implicit base class member, change the name of the derived class member to avoid conflicts with names listed in the previous table.

See Also

Concepts

Declared Element Names