Informix Error -4131
-4131 No implied object for this non-shared function call ("SELF" is
not defined in this context).No object reference has been supplied for this member function call. If the member function call was made inside a member function, "self" would be the implied object reference. This call was made in a nonmember function body, so there is no implied object reference.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4131 fires when a member function is called with no object reference supplied, outside a
member function body — per the official guidance, SELF is only implied as the object
reference inside a member function; a non-member function body has no implied object.
- A non-
SHAREDmember function called with no explicit object reference, from a non-member function body, per the official guidance — the direct, only cause.
Solutions / Resolution
- Call the member function through an explicit object reference (
object.method()) when calling from outside a member function body.
Examples
A member function call with no object, outside a class
FUNCTION main()
CALL save()
-- -4131: no implied SELF exists in a non-member function
END FUNCTION
Corrected
FUNCTION main()
DEFINE o Order
CALL o.save()
END FUNCTION
Diagnostic Checks
- Check whether the call site is inside a member function body, and if not, supply an explicit object reference for the member function call.
Related Errors / Related Topics
- -4021 — "A class member cannot be named "SELF"." A related
SELF-identifier restriction, about naming a memberSELFrather than a missing implied object. - -4070 — "Cannot assign to "SELF"." A related
SELF-identifier restriction, about assigning toSELFrather than a missing implied object.
A member function is called with no object reference outside a member function body — supply an explicit object reference.