Informix Error -4005: You cannot redefine private base member function "name".
Cause and resolution
You cannot redefine private base member function "name".
This FUNCTION declaration in a class declaration names a member that is inherited from a base class of this class. However, that inherited name is declared as PRIVATE, so it cannot be overridden in this class. Review the declarations of all base classes; then choose a name for your function that will be unique to this class.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4005 fires when a class's FUNCTION declaration names a member inherited from a base class,
but that inherited member is PRIVATE in the base class — per the official guidance, a
PRIVATE base member can't be overridden in a derived class.
- A
FUNCTIONdeclaration reusing a name inherited asPRIVATEfrom a base class, per the official guidance — the direct, only cause.
Solutions / Resolution
- Review the declarations of all base classes, per the official guidance.
- Choose a name for the function that's unique to this class, per the official guidance.
Examples
Redefining a private base member
CLASS Base
FUNCTION PRIVATE helper()
...
END FUNCTION
END CLASS
CLASS Derived : Base
FUNCTION helper()
-- -4005: helper is PRIVATE in Base and cannot be overridden
END FUNCTION
END CLASS
Corrected
CLASS Derived : Base
FUNCTION derivedHelper()
...
END FUNCTION
END CLASS
Diagnostic Checks
- Check all base classes for a
PRIVATEfunction of the same name, and rename the derived class's function if one is found.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4005 in this set yet.
A function name collides with a PRIVATE base-class member function — rename it to something
unique to this class.