From af4895f0bb06fd5fd6c0b664241102360b48be69 Mon Sep 17 00:00:00 2001
From: pw <pw>
Date: Thu, 22 Jan 1998 12:32:52 +0000
Subject: [PATCH] While loading an :around method when no primary method
 exists, a compiler warning like ".ARG0. is defined but not used" was being
 emitted. Turns out that in such a case PCL generates an effective-method
 consisting of (error "No primary method for ...") or some such, thus ignoring
 the user method and not passing the supplied arguments to error. This change
 checks for the above case and inserts an ignorable declaration for the method
 arguments.

---
 pcl/combin.lisp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/pcl/combin.lisp b/pcl/combin.lisp
index d6bdd87b5..ac83e859d 100644
--- a/pcl/combin.lisp
+++ b/pcl/combin.lisp
@@ -171,9 +171,14 @@
   (multiple-value-bind (nreq applyp metatypes nkeys arg-info)
       (get-generic-function-info gf)
     (declare (ignore nreq nkeys arg-info))
-    `(lambda ,(make-fast-method-call-lambda-list metatypes applyp)
-       (declare (ignore .pv-cell. .next-method-call.))
-       ,effective-method)))
+    (let ((ll (make-fast-method-call-lambda-list metatypes applyp))
+	  ;; When there are no primary methods and a next-method call occurs
+	  ;; effective-method is (error "No mumble..") and the defined
+	  ;; args are not used giving a compiler warning.
+	  (error-p (eq (first effective-method) 'error)))
+      `(lambda ,ll
+	 (declare (ignore ,@(if error-p ll '(.pv-cell. .next-method-call.))))
+	 ,effective-method))))
 
 (defun expand-emf-call-method (gf form metatypes applyp env)
   (declare (ignore gf metatypes applyp env))
-- 
GitLab