From 21da28bd870a7e0a8fbd9a682ef4b5c7b768705e Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 1 Oct 2004 13:24:21 +0000 Subject: [PATCH] 0.8.15.5: Fix for DEFGENERIC/FUNCTION/:METHOD interaction (Zach Beane 2004-09-29 sbcl-devel) --- NEWS | 3 +++ src/pcl/boot.lisp | 2 +- tests/clos.impure.lisp | 8 ++++++++ version.lisp-expr | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 7c09acf..aa8b1eb 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,9 @@ changes in sbcl-0.8.16 relative to sbcl-0.8.15: redefinition of generic functions with no DEFGENERIC to an incompatible lambda list now signals an error. (thanks to Zach Beane) + * bug fix: DEFGENERIC now works even when there's a function of the + same name in an enclosing lexical environment. (thanks to Zach + Beane) * fixed some bugs revealed by Paul Dietz' test suite: ** POSITION on displaced vectors with non-zero displacement returns the right answer. diff --git a/src/pcl/boot.lisp b/src/pcl/boot.lisp index c82b16d..1f7a23b 100644 --- a/src/pcl/boot.lisp +++ b/src/pcl/boot.lisp @@ -165,7 +165,7 @@ bootstrapping. (qualifiers (subseq qab 0 arglist-pos)) (body (nthcdr (1+ arglist-pos) qab))) `(push (defmethod ,fun-name ,@qualifiers ,arglist ,@body) - (generic-function-initial-methods #',fun-name))))) + (generic-function-initial-methods (fdefinition ',fun-name)))))) (macrolet ((initarg (key) `(getf initargs ,key))) (dolist (option options) (let ((car-option (car option))) diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 94b3dc5..c0b4d5a 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -840,6 +840,14 @@ (defgeneric nonsense ()))))) 'generic-function)) +(assert + (typep (funcall (compile nil + '(lambda () (flet ((nonsense-2 () nil)) + (defgeneric nonsense-2 () + (:method () t)))))) + 'generic-function)) + + ;;;; success (sb-ext:quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 169c7d3..cf3bcc3 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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.8.15.4" +"0.8.15.5" -- 1.7.10.4