(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. "
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.
(noptional 0)
(keysp nil)
(restp nil)
+ (nrest 0)
(allow-other-keys-p nil)
(keywords ())
(keyword-parameters ())
(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)))))
(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
;; 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)
()
;;; 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))
-\f
+
+;;; 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)
;;; 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"