0.8.16.2: TYPE-ERROR for ERROR
[sbcl.git] / tests / clos.impure-cload.lisp
index e9e09b5..26dd594 100644 (file)
 (assert (eq 'orig-initform
            (slot-value (make-instance 'shared-to-local-initform-sub) 'redefined)))
 \f
+(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)))
+\f
+;;; 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))
+\f
 ;;; success
-(sb-ext:quit :unix-status 104)
\ No newline at end of file
+(sb-ext:quit :unix-status 104)