From 49e8ac7d414d7fe7424374d9cc98bb41f8bd60f8 Mon Sep 17 00:00:00 2001 From: gerd <gerd> Date: Tue, 29 Jul 2003 12:13:24 +0000 Subject: [PATCH] * src/pcl/methods.lisp (real-add-method): Warn about invalid method qualifiers. --- pcl/methods.lisp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pcl/methods.lisp b/pcl/methods.lisp index 0a6a3a2d0..4890da1d3 100644 --- a/pcl/methods.lisp +++ b/pcl/methods.lisp @@ -26,7 +26,7 @@ ;;; (file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/methods.lisp,v 1.40 2003/07/21 17:36:47 gerd Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/methods.lisp,v 1.41 2003/07/29 12:13:24 gerd Exp $") (in-package :pcl) @@ -460,6 +460,25 @@ (when remove-again-p (remove-method gf method)))) ;; + ;; Warn about invalid qualifiers, if we can. + (let ((mc (generic-function-method-combination gf))) + (cond ((eq mc *standard-method-combination*) + (when (and qualifiers + (or (cdr qualifiers) + (not (memq (car qualifiers) + '(:around :before :after))))) + (warn "~@<Method ~s contains invalid qualifiers for ~ + the standard method combination.~@:>" + method))) + ((short-method-combination-p mc) + (let ((mc-name (method-combination-type mc))) + (when (or (/= (length qualifiers) 1) + (and (neq (car qualifiers) :around) + (neq (car qualifiers) mc-name))) + (warn "~@<Method ~s contains invalid qualifiers for ~ + the method combination ~s.~@:>" + method mc-name)))))) + ;; (unless skip-dfun-update-p (update-ctors 'add-method :generic-function gf :method method) (update-dfun gf)) -- GitLab