0.8.12.15:
[sbcl.git] / tests / clos.impure-cload.lisp
index d866200..46f83e6 100644 (file)
@@ -73,7 +73,7 @@
 ;;; in a similar vein, we should be able to define methods on classes
 ;;; that are effectively unknown to the type system:
 (sb-mop:ensure-class 'unknown-type)
-(defmethod method ((x unknown-type)) x)
+(defmethod method-on-unknown ((x unknown-type)) x)
 ;;; (we can't call it without defining methods on allocate-instance
 ;;; etc., but we should be able to define it).
 \f
 (assert (= (slot-value (make-instance 'definitargs-class) 'a) 1))
 (assert (= (slot-value (make-instance 'definitargs-class :a 0) 'a) 0))
 (assert (= *definitargs-counter* 2))
+
+;;; inherited local -> shared slot initforms
+;;  (adapted from Paul F. Dietz's test suite DEFCLASS-0211.1)
+(defclass shared-to-local-initform-super ()
+  ((redefined :allocation :instance :initform 'orig-initform)))
+(defclass shared-to-local-initform-sub (shared-to-local-initform-super)
+  ((redefined :allocation :class)))
+(assert (slot-boundp (make-instance 'shared-to-local-initform-sub) 'redefined))
+(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
 ;;; success
-(sb-ext:quit :unix-status 104)
\ No newline at end of file
+(sb-ext:quit :unix-status 104)