Informix Error -4092: Type mismatch between CLASS and non-CLASS type.
Cause and resolution
Type mismatch between CLASS and non-CLASS type.
The compiler attempted to convert the result of one expression to conform with the type of another expression, and only one of them was a CLASS. Either both must be CLASS type, or neither can be.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4092 fires when the compiler tries to reconcile two expressions' types and only one of them
is a CLASS — per the official guidance, either both expressions must be CLASS type, or
neither can be.
- An expression pairing a class-typed value with a non-class type, per the official guidance — the direct, only cause.
Solutions / Resolution
- Make both sides of the expression consistently class-typed or non-class-typed.
Examples
Comparing a class instance to a plain value
DEFINE o Order
IF o = 5 THEN
-- -4092: o is a CLASS, 5 is not
END IF
Corrected
IF o.order_id = 5 THEN
...
END IF
Diagnostic Checks
- Check every expression pairing a class-typed value with another type, and make both sides consistent.
Related Errors / Related Topics
- -4091 — "Cannot assign to or refer to an array as a whole. Use indexing to refer to
individual elements." The same type-reconciliation principle applied to
ARRAYvalues rather thanCLASSvalues. - -4093 — "Type mismatch between RECORD and non-RECORD type." The same
type-reconciliation principle applied to
RECORDvalues rather thanCLASSvalues.
An expression pairs a CLASS-typed value with a non-class type — make both sides consistent.