X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos.impure-cload.lisp;h=46f83e609d2436a8e415e6efb922f19e3eac71ee;hb=a14326d4e328c778cd292884099eee7d2c1b8d0f;hp=d866200d90383253154a883ec2b6982d2b1d206b;hpb=2deca07b781acdf0214dacf5a7444756dfba6928;p=sbcl.git diff --git a/tests/clos.impure-cload.lisp b/tests/clos.impure-cload.lisp index d866200..46f83e6 100644 --- a/tests/clos.impure-cload.lisp +++ b/tests/clos.impure-cload.lisp @@ -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). @@ -94,6 +94,30 @@ (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))) + +(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))) ;;; success -(sb-ext:quit :unix-status 104) \ No newline at end of file +(sb-ext:quit :unix-status 104)