Informix Error -4051: Member "name" is defined in class "class", but not as a function.
Cause and resolution
Member "name" is defined in class "class", but not as a function.
This statement tries to invoke class::member(), either directly or as object.member(). The class has a member of that name, but it is a member variable, not a function. Check the spelling of the member name and the class or object name. Review the declaration of the class for the correct spelling of its member names.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4051 fires when code tries to invoke class::member() or object.member(), but the class
has a member of that name that's a variable, not a function — per the official guidance, the
member exists, just not as something callable.
- A member invoked as a function that's actually defined as a variable, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check the spelling of the member name and the class or object name, per the official guidance.
- Review the class declaration for the correct spelling of its member names, per the official guidance.
Examples
Calling a member variable as if it were a function
LET x = order.total()
-- -4051: total is a member variable on Order, not a function
Corrected
LET x = order.total
Diagnostic Checks
- Check the class declaration for the named member's actual kind, and reference it as a variable rather than calling it.
Related Errors / Related Topics
- -4044 — "Member "name" not defined in class "class"." A related member-access error, about a member that doesn't exist at all rather than one that exists but isn't a function.
- -4045 — "Member "name" is defined in class "class", but not as a variable or constant." The mirror-image error, about a member expected to be a variable/constant but actually being a function.
A member is invoked like a function but is actually a variable — reference it directly instead of calling it.