X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos.impure-cload.lisp;h=26dd5948e0d6ce4555b423dda0840ecac90e5aa1;hb=15d6e7c9a2c3234f95dfe278046fa2fee1b0c007;hp=e9e09b5f8d6ca165788327bfc6dea1a8816df814;hpb=ff92598854bf7cae8d57fe49cef4d9a98e1ab345;p=sbcl.git diff --git a/tests/clos.impure-cload.lisp b/tests/clos.impure-cload.lisp index e9e09b5..26dd594 100644 --- a/tests/clos.impure-cload.lisp +++ b/tests/clos.impure-cload.lisp @@ -105,5 +105,35 @@ (assert (eq 'orig-initform (slot-value (make-instance 'shared-to-local-initform-sub) 'redefined))) +(defgeneric no-ignored-warnings (x y)) +(handler-case + (eval '(defmethod no-ignored-warnings ((x t) (y t)) + (declare (ignore x y)) nil)) + (style-warning (c) (error c))) +(handler-case + (eval '(defmethod no-ignored-warnings ((x number) (y t)) + (declare (ignore x y)) (setq *print-level* nil))) + (style-warning (c) (error c))) +(handler-case + (eval '(defmethod no-ignored-warnings ((x fixnum) (y t)) + (declare (ignore x)) (setq y 'foo))) + (style-warning (c) (error c))) + +;;; from Axel Schairer on cmucl-imp 2004-08-05 +(defclass class-with-symbol-initarg () + ((slot :initarg slot))) +(defmethod initialize-instance :after + ((x class-with-symbol-initarg) &rest initargs &key &allow-other-keys) + (unless (or (null initargs) + (eql (getf initargs 'slot) + (slot-value x 'slot))) + (error "bad bad bad"))) +(defun make-thing (arg) + (make-instance 'class-with-symbol-initarg 'slot arg)) +(defun make-other-thing (slot arg) + (make-instance 'class-with-symbol-initarg slot arg)) +(assert (eql (slot-value (make-thing 1) 'slot) 1)) +(assert (eql (slot-value (make-other-thing 'slot 2) 'slot) 2)) + ;;; success -(sb-ext:quit :unix-status 104) \ No newline at end of file +(sb-ext:quit :unix-status 104)