Informix Error -4055: Overriding the constructor of a base class is not allowed.
Cause and resolution
Overriding the constructor of a base class is not allowed.
This FUNCTION declaration in a CLASS statement specifies a function whose name is the same as the name of a base of this class. In other words, you are trying to override the constructor function of a base class. This action is not permitted. Review the names of members that are inherited by this class, and choose unique names for its member functions.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4055 fires when a class declares a FUNCTION whose name matches one of its base classes —
per the official guidance, this amounts to trying to override the base class's constructor
function, which isn't permitted.
- A member function named the same as one of the class's base classes, per the official guidance — the direct, only cause.
Solutions / Resolution
- Review the names of members inherited by this class, per the official guidance.
- Choose unique names for its member functions, per the official guidance.
Examples
A member function named after a base class
CLASS Order DERIVED FROM Base
FUNCTION Base()
-- -4055: this collides with Base's own constructor name
END FUNCTION
END CLASS
Corrected
CLASS Order DERIVED FROM Base
FUNCTION initialize()
...
END FUNCTION
END CLASS
Diagnostic Checks
- Check every member function's name against all base class names, and rename any that collide.
Related Errors / Related Topics
- -4033 — "Base member name "name" cannot be used for class name." A related naming-collision error, about a class's own name colliding with an inherited member, rather than a member function colliding with a base class's name.
A member function is named the same as a base class, effectively trying to override its constructor — rename the function.