Informix Error -4096
-4096 Expression class must be equal to or derived from result class.
The statement attempted to assign a value of one class to an object of a different class that is not derivable from the former class.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4096 fires when a statement assigns a value of one class to an object of a different class that isn't derivable from the source class — per the official guidance, the target class must either match the source class or be a class the source is derived into.
- Assigning a value whose class isn't equal to, or a valid derivation target of, the receiving object's class, per the official guidance — the direct, only cause.
Solutions / Resolution
- Assign a value whose class matches, or is compatible with derivation into, the receiving object's class.
Examples
Assigning an incompatible class
DEFINE o UnrelatedClass
DEFINE b BaseClass
LET b = o
-- -4096: UnrelatedClass is not equal to or derivable into BaseClass
Corrected
DEFINE d DerivedClass
LET b = d
-- DerivedClass derives from BaseClass
Diagnostic Checks
- Check the class hierarchy to confirm the assigned value's class is equal to or compatible with the receiving object's class.
Related Errors / Related Topics
- -4076 — "Class of CAST object must be a base of class specified as right argument." A
related class-compatibility error, about
CASTexpressions specifically rather than a general assignment.
A value's class isn't compatible with the receiving object's class — check the class hierarchy.