From fb25587a879433b8e475bc7b1fad918ef43fb709 Mon Sep 17 00:00:00 2001 From: Nick Levine Date: Sun, 26 May 2013 13:16:42 +0100 Subject: [PATCH] (Bug #308954: Wrong error from methodless generic function) no-applicable-method will be called when a methodless gf is invoked. Check whether there are any methods and craft the error message appropriately. (I dithered about whether the message could tell you that you also got the argument count wrong; in the end, I decided that getting a less misleading message is good enough. I also dithered about whether or not this error should fire a call to no-applicable-method; I concluded that there isn't any applicable method -- there are no methods at all.) --- src/pcl/braid.lisp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pcl/braid.lisp b/src/pcl/braid.lisp index ce6bbc1..b043b4f 100644 --- a/src/pcl/braid.lisp +++ b/src/pcl/braid.lisp @@ -711,8 +711,13 @@ (setq **boot-state** 'braid) (defmethod no-applicable-method (generic-function &rest args) - (error "~@" + (if (if (early-gf-p generic-function) + (early-gf-methods generic-function) + (safe-generic-function-methods generic-function)) + "is no applicable method" + "are no methods at all") generic-function args)) -- 1.8.2.1