From: William Harold Newman Date: Thu, 10 Jan 2002 02:16:36 +0000 (+0000) Subject: 0.pre7.120: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=2b136dcaa0dda4db2a8e4b0c4d94e15695fb9c9c;p=sbcl.git 0.pre7.120: MNA patch for bug 38 (sbcl-devel 2002-01-07) removed BUGS entries 18 and 29 as per MNA sbcl-devel 2002-01-07 --- diff --git a/BUGS b/BUGS index 86d149e..a833316 100644 --- a/BUGS +++ b/BUGS @@ -126,45 +126,9 @@ WORKAROUND: (Also, when this is fixed, we can enable the code in PROCLAIM which checks for incompatible FTYPE redeclarations.) -18: - from DTC on the CMU CL mailing list 25 Feb 2000: -;;; Compiler fails when this file is compiled. -;;; -;;; Problem shows up in delete-block within ir1util.lisp. The assertion -;;; (assert (member (functional-kind lambda) '(:let :mv-let :assignment))) -;;; fails within bind node branch. -;;; -;;; Note that if c::*check-consistency* is enabled then an un-reached -;;; entry is also reported. -;;; -(defun foo (val) - (declare (values nil)) - nil) -(defun bug (val) - (multiple-value-call - #'(lambda (res) - (block nil - (tagbody - loop - (when res - (return nil)) - (go loop)))) - (foo val)) - (catch 'ccc1 - (throw 'ccc1 - (block bbbb - (tagbody - - (let ((ttt #'(lambda () (go cccc)))) - (declare (special ttt)) - (return-from bbbb nil)) - - cccc - (return-from bbbb nil)))))) - 19: (I *think* this is a bug. It certainly seems like strange behavior. But - the ANSI spec is scary, dark, and deep..) + the ANSI spec is scary, dark, and deep.. -- WHN) (FORMAT NIL "~,1G" 1.4) => "1. " (FORMAT NIL "~3,1G" 1.4) => "1. " @@ -191,24 +155,6 @@ WORKAROUND: Process inferior-lisp exited abnormally with code 1 I haven't noticed a repeatable case of this yet. -29: - some sort of bug in inlining and RETURN-FROM in sbcl-0.6.5: Compiling - (DEFUN BAR? (X) - (OR (NAR? X) - (BLOCK USED-BY-SOME-Y? - (FLET ((FROB (STK) - (DOLIST (Y STK) - (UNLESS (REJECTED? Y) - (RETURN-FROM USED-BY-SOME-Y? T))))) - (DECLARE (INLINE FROB)) - (FROB (RSTK X)) - (FROB (MRSTK X))) - NIL))) - gives - error in function SB-KERNEL:ASSERT-ERROR: - The assertion (EQ (SB-C::CONTINUATION-KIND SB-C::CONT) :BLOCK-START) failed. - This is still present in sbcl-0.6.8. - 31: In some cases the compiler believes type declarations on array elements without checking them, e.g. diff --git a/src/pcl/boot.lisp b/src/pcl/boot.lisp index 221647a..3761c09 100644 --- a/src/pcl/boot.lisp +++ b/src/pcl/boot.lisp @@ -1299,6 +1299,7 @@ bootstrapping. (noptional 0) (keysp nil) (restp nil) + (nrest 0) (allow-other-keys-p nil) (keywords ()) (keyword-parameters ()) @@ -1321,7 +1322,11 @@ bootstrapping. (optional (incf noptional)) (key (push (parse-key-argument x) keywords) (push x keyword-parameters)) - (rest ())))) + (rest (incf nrest))))) + (when (and restp (zerop nrest)) + (error "Error in lambda-list:~%~ + After &REST, a DEFGENERIC lambda-list ~ + must be followed by at least one variable.")) (values nrequired noptional keysp restp allow-other-keys-p (reverse keywords) (reverse keyword-parameters))))) @@ -2158,17 +2163,12 @@ bootstrapping. (values nil arglist nil)) ((memq arg lambda-list-keywords) (unless (memq arg '(&optional &rest &key &allow-other-keys &aux)) - ;; Warn about non-standard lambda-list-keywords, but then - ;; go on to treat them like a standard lambda-list-keyword - ;; what with the warning its probably ok. - ;; - ;; FIXME: This shouldn't happen now that this is maintained - ;; as part of SBCL, should it? Perhaps this is now - ;; "internal error: unrecognized lambda-list keyword ~S"? - (warn "Unrecognized lambda-list keyword ~S in arglist.~%~ - Assuming that the symbols following it are parameters,~%~ - and not allowing any parameter specializers to follow it." - arg)) + ;; Now, since we try to conform to ANSI, non-standard + ;; lambda-list-keywords should be treated as errors. + (error 'simple-program-error + :format-control "unrecognized lambda-list keyword ~S ~ + in arglist.~%" + :format-arguments (list arg))) ;; When we are at a lambda-list keyword, the parameters ;; don't include the lambda-list keyword; the lambda-list ;; does include the lambda-list keyword; and no @@ -2176,6 +2176,13 @@ bootstrapping. ;; keywords (at least for now). (multiple-value-bind (parameters lambda-list) (parse-specialized-lambda-list (cdr arglist) t) + (when (eq arg '&rest) + ;; check, if &rest is followed by a var ... + (when (or (null lambda-list) + (memq (car lambda-list) lambda-list-keywords)) + (error "Error in lambda-list:~%~ + After &REST, a DEFMETHOD lambda-list ~ + must be followed by at least one variable."))) (values parameters (cons arg lambda-list) () diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 295e360..edcfcd0 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -51,7 +51,32 @@ ;;; bug reported and fixed by Alexey Dejneka sbcl-devel 2001-09-10: ;;; This DEFGENERIC shouldn't cause an error. (defgeneric ad-gf (a) (:method :around (x) x)) - + +;;; DEFGENERIC and DEFMETHOD shouldn't accept &REST when it's not +;;; followed by a variable: +;;; e.g. (DEFMETHOD FOO ((X T) &REST) NIL) should signal an error. +(eval-when (:load-toplevel :compile-toplevel :execute) + (defmacro expect-error (&body body) + `(multiple-value-bind (res condition) + (ignore-errors (progn ,@body)) + (declare (ignore res)) + (typep condition 'error)))) + +(assert (expect-error + (macroexpand-1 + '(defmethod foo0 ((x t) &rest) nil)))) + +(assert (expect-error (defgeneric foo1 (x &rest)))) +(assert (expect-error (defgeneric foo2 (x a &rest)))) + +(defgeneric foo3 (x &rest y)) +(defmethod foo3 ((x t) &rest y) nil) +(defmethod foo4 ((x t) &key y &rest z) nil) +(defgeneric foo4 (x &key y &rest z)) + +(assert (expect-error (defgeneric foo5 (x &rest)))) +(assert (expect-error (macroexpand-1 '(defmethod foo6 (x &rest))))) + ;;; structure-class tests setup (defclass structure-class-foo1 () () (:metaclass cl:structure-class)) (defclass structure-class-foo2 (structure-class-foo1) diff --git a/version.lisp-expr b/version.lisp-expr index 1813232..86571b2 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; for internal versions, especially for internal versions off the ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.pre7.119" +"0.pre7.120"