Informix Error -4099
-4099 Type to CAST to must be a class.
The right argument to the CAST operator in this statement is not the name of a class. Review the syntax and spelling of the statement. Make sure that you have included all necessary header files to declare classes.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4099 fires when the right argument to CAST isn't the name of a class — per the official
guidance, CAST's target type must be a class.
- A
CAST's right argument isn't a class name, per the official guidance — the direct, only cause.
Solutions / Resolution
- Review the syntax and spelling of the statement, per the official guidance.
- Make sure all necessary header files declaring the intended class are included, per the official guidance.
Examples
Casting to a non-class type
LET x = CAST(o AS INTEGER)
-- -4099: INTEGER is not a class
Corrected
LET x = CAST(o AS DerivedClass)
Diagnostic Checks
- Check the
CAST's right argument, and confirm it's a declared class name, including whether the class's header file is included.
Related Errors / Related Topics
- -4076 — "Class of CAST object must be a base of class specified as right argument." A
related
CAST-expression error, about the target class not being derivable from the object's stated class, rather than the target not being a class at all.
A CAST's right argument isn't a class name — check its spelling and whether the class's
header file is included.