Skip to content

Commit

Permalink
0.9.15.15:
Browse files Browse the repository at this point in the history
	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.
  • Loading branch information
csrhodes committed Aug 8, 2006
1 parent 03607fd commit 60639fa
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 20 deletions.
16 changes: 1 addition & 15 deletions BUGS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/pcl/defcombin.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,12 @@
(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))
Expand Down
23 changes: 23 additions & 0 deletions tests/clos.impure.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1346,4 +1346,27 @@
;;; cache with more than one key, then failure ensues.
(reinitialize-instance #'print-object)

;;; 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

;;;; success
2 changes: 1 addition & 1 deletion version.lisp-expr
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 60639fa

Please sign in to comment.