Informix Error -4035: Function "name" cannot be redefined in a derived class "class" with different access permissions.
Cause and resolution
Function "name" cannot be redefined in a derived class "class" with different access permissions.
The parent class of the function "name" has an access permission (PRIVATE, PROTECTED, or PUBLIC) different from this declaration.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4035 fires when a derived class redefines an inherited function with a different access
permission than its parent declared — per the official guidance, the parent class's function
has a PRIVATE, PROTECTED, or PUBLIC permission different from this declaration.
- A redefined function's access permission doesn't match its base-class declaration, per the official guidance — the direct, only cause.
Solutions / Resolution
- Match the redefined function's access permission to its base-class declaration.
Examples
A mismatched access permission on override
CLASS Base
FUNCTION PUBLIC save()
...
END FUNCTION
END CLASS
CLASS Derived DERIVED FROM Base
FUNCTION PRIVATE save()
-- -4035: Base declares save() PUBLIC, not PRIVATE
END FUNCTION
END CLASS
Corrected
CLASS Derived DERIVED FROM Base
FUNCTION PUBLIC save()
...
END FUNCTION
END CLASS
Diagnostic Checks
- Check the base class's access permission for the function being redefined, and match it in the derived class.
Related Errors / Related Topics
- -4036 — "Function "name" cannot be redefined in a derived class "class" with different
scope of reference." A related function-redefinition error, about mismatched
SHAREDness rather than mismatched access permission.
A redefined function's access permission doesn't match its base class's declaration — make them match.