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

Prev:inconsistent-next-method ( class generic -- * )


Vocabulary
generic

Error description
Thrown by call-next-method if the current method is already the least specific method.

Examples
The following code throws this error:
GENERIC: error-test ( object -- ) M: number error-test 3 + call-next-method ; M: integer error-test recip call-next-method ; 123 error-test

This results in the method on integer being called, which then calls the method on number. The latter then calls call-next-method, however there is no method less specific than the method on number and so an error is thrown.

Definition


Methods

M: no-next-method summary
drop "Executing call-next-method from least-specific method"
;