0.9.15.15:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 8 Aug 2006 14:24:24 +0000 (14:24 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 8 Aug 2006 14:24:24 +0000 (14:24 +0000)
Fix bug #339c: INVALID-METHOD-ERROR from methods not matching
any method group.
... I'm actually not convinced by this fix: I think the method
combination itself should probably call I-M-E, rather
than have the effective method call it (see CLHS on
INVALID-METHOD-ERROR); however, at the moment, given
PRECOMPUTE-EFFECTIVE-METHOD's behaviour, this is the
only way to signal the error at the right time.  Revisit
when/if effective-method precomputation is adjusted.

BUGS
NEWS
src/pcl/defcombin.lisp
tests/clos.impure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index 6e719bc..be6f906 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1228,21 +1228,7 @@ WORKAROUND:
    iii. supplied-p variables for &optional and &key arguments are not
         bound.
 
-  c. qualifier matching incorrect
-  (progn
-    (define-method-combination mc27 () 
-        ((normal ()) 
-         (ignored (:ignore :unused)))
-      `(list 'result 
-             ,@(mapcar #'(lambda (method) `(call-method ,method)) normal)))
-    (defgeneric test-mc27 (x)
-      (:method-combination mc27)
-      (:method :ignore ((x number)) (/ 0)))
-    (test-mc27 7))
-
-  should signal an invalid-method-error, as the :IGNORE (NUMBER)
-  method is applicable, and yet matches neither of the method group
-  qualifier patterns.
+  c. (fixed in sbcl-0.9.15.15)
 
 344: more (?) ROOM T problems (possibly part of bug 108)
   In sbcl-0.8.12.51, and off and on leading up to it, the
diff --git a/NEWS b/NEWS
index a6b852b..6e3cb20 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,14 +5,19 @@ changes in sbcl-0.9.16 relative to sbcl-0.9.15:
     as specified by AMOP.
   * optimization: faster LOGCOUNT implementation on x86 and x86-64
     (thanks to Lutz Euler)
+  * fixed bug #337: use of MAKE-METHOD in method combination now works
+    even in the presence of user-defined method classes.  (reported by
+    Bruno Haible and Pascal Costanza)
+  * fixed bug #339(c): if there are applicable methods not part of any
+    long-form method-combination group, call INVALID-METHOD-ERROR.
+    (reported by Bruno Haible)
   * bug fix: improved the handling of type declarations and the
     detection of violations for keyword arguments with non-constant
     defaults.
-  * bug fix: use of MAKE-METHOD in method combination now works even
-    in the presence of user-defined method classes.  (reported by
-    Bruno Haible and Pascal Costanza)
   * bug fix: erronous calls to PATHNAME were being optimized away.
     (reported by Richard Kreuter)
+  * bug fix: compiled calls to TYPEP were mishandling obsolete
+    instances.  (reported by James Bielman and Attila Lendvai)
 
 changes in sbcl-0.9.15 relative to sbcl-0.9.14:
   * added support for the ucs-2 external format.  (contributed by Ivan
index 711696f..f3296a9 100644 (file)
     (method-group-specifiers declarations real-body)
   (let (names specializer-caches cond-clauses required-checks order-cleanups)
     (let ((nspecifiers (length method-group-specifiers)))
-      (dolist (method-group-specifier method-group-specifiers)
+      (dolist (method-group-specifier method-group-specifiers
+               (push `(t (return-from .long-method-combination-function.
+                           `(invalid-method-error , .method.
+                             "~@<is applicable, but does not belong ~
+                              to any method group~@:>")))
+                     cond-clauses))
         (multiple-value-bind (name tests description order required)
             (parse-method-group-specifier method-group-specifier)
           (declare (ignore description))
index 27bbf45..f05a40e 100644 (file)
 ;;; cache with more than one key, then failure ensues.
 (reinitialize-instance #'print-object)
 \f
+;;; bug in long-form method combination: if there's an applicable
+;;; method not part of any method group, we need to call
+;;; INVALID-METHOD-ERROR.  (MC27 test case from Bruno Haible)
+(define-method-combination mc27 ()
+  ((normal ())
+   (ignored (:ignore :unused)))
+  `(list 'result
+    ,@(mapcar #'(lambda (method) `(call-method ,method)) normal)))
+(defgeneric test-mc27 (x)
+  (:method-combination mc27)
+  (:method :ignore ((x number)) (/ 0)))
+(assert (raises-error? (test-mc27 7)))
+
+(define-method-combination mc27prime ()
+  ((normal ())
+   (ignored (:ignore)))
+  `(list 'result ,@(mapcar (lambda (m) `(call-method ,m)) normal)))
+(defgeneric test-mc27prime (x)
+  (:method-combination mc27prime)
+  (:method :ignore ((x number)) (/ 0)))
+(assert (equal '(result) (test-mc27prime 3)))
+(assert (raises-error? (test-mc27 t))) ; still no-applicable-method
+\f
 ;;;; success
index d3a8d88..7c7e6b1 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.15.14"
+"0.9.15.15"