Product Information > JADE Error Messages and System Messages > 6000 through 6999 - JADE Compiler Errors > 6112 - Return expression mismatch

6112   Return expression mismatch

Cause

This error occurs if the type of the value returned by a return instruction is not compatible with the defined return type of the method.

If the return type of the method is a class, the value that is returned must be an instance of that class or one of its subclasses. If the return type is a primitive type, the value that is returned must be assignment-compatible with that type.

For details about assignment compatibility rules for primitive types, see "Assignment Compatibility" or "Instructions, Expressions, and Assignments", in Chapter 1 of the JADE Developer’s Reference.

Action

Modify the return type of the method or the type of the returned value, in order to make them compatible. In some cases, it may be possible to add a type cast to the return expression to make it compatible with the method return type.