inconsistent-next-method ( class generic -- * )
Factor handbook » The language » Objects » Generic words and methods » Calling less-specific methods

Prev:next-method ( class generic -- method/f )
Next:no-next-method ( method -- * )


Vocabulary
generic.single

Error description
Thrown by call-next-method if the values on the stack are not compatible with the current method.

Examples
The following code throws this error:
GENERIC: error-test ( object -- ) M: string error-test print ; M: integer error-test number>string call-next-method ; 123 error-test

This results in the method on integer being called, which then passes a string to call-next-method. However, this fails because the string is not compatible with the current method.

This usually indicates programmer error; if the intention above was to call the string method on the result of number>string, the code should be rewritten as follows:
M: integer error-test number>string error-test ;


Definition


Methods

M: inconsistent-next-method summary
drop
"Executing call-next-method with inconsistent parameters" ;