MSIR.0883 Class (classname) -- inherited classes (classname) and (classname) contain members with the same name

From m204wiki
Revision as of 16:45, 9 November 2010 by Admin (talk | contribs) (1 revision)
Jump to navigation Jump to search

A class that extends at least two base classes, both of which were qualified with the Inherit keyword in the Extends clause, inherited the same named member from both base classes.

  • th Other than fixing the method names in the base classes, there are two ways to correct this problem:
    • Add the IgnoreDuplicates keyword after the Inherit keyword for the second base class in the Extends clause. This is not highly recommended, because it could mask future conflicts caused by adding a method to the first base class with the same name as the one in the second base class. In such a case, the new method in the first base class will preempt the method in the second, even though the second was formerly used. If one is lucky, a compile error will flag the problem. If unlucky, the application will silently do the wrong thing.
    • Explicitly Inherit the conflicting name using the Inherit statement in the Public block. This is the recommended approach.