X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpcl%2Fmethods.lisp;h=ab5110e8217289d35745032e9e572268d230a2bc;hb=5b43e28a5a9f0fcdefc2132840492e2e382876c6;hp=855c9076893e2cfcf36917e204ce9265d242bb91;hpb=cf42b486323a8c50ee1d937ba3eee33777575905;p=sbcl.git diff --git a/src/pcl/methods.lisp b/src/pcl/methods.lisp index 855c907..ab5110e 100644 --- a/src/pcl/methods.lisp +++ b/src/pcl/methods.lisp @@ -494,6 +494,33 @@ (setq remove-again-p nil)) (when remove-again-p (remove-method generic-function method)))) + + ;; KLUDGE II: ANSI saith that it is not an error to add a + ;; method with invalid qualifiers to a generic function of the + ;; wrong kind; it's only an error at generic function + ;; invocation time; I dunno what the rationale was, and it + ;; sucks. Nevertheless, it's probably a programmer error, so + ;; let's warn anyway. -- CSR, 2003-08-20 + (let ((mc (generic-function-method-combination generic-functioN))) + (cond + ((eq mc *standard-method-combination*) + (when (and qualifiers + (or (cdr qualifiers) + (not (memq (car qualifiers) + '(:around :before :after))))) + (warn "~@" + method qualifiers))) + ((short-method-combination-p mc) + (let ((mc-name (method-combination-type mc))) + (when (or (null qualifiers) + (cdr qualifiers) + (and (neq (car qualifiers) :around) + (neq (car qualifiers) mc-name))) + (warn "~@" + mc-name method qualifiers)))))) + (unless skip-dfun-update-p (update-ctors 'add-method :generic-function generic-function