X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos.impure.lisp;h=46a36a8ba82e094a6645a9cd53e972e986680fab;hb=1f03c7f326823245708a84af86b31ac72bdb1742;hp=447639e1cebc82d8a51e77a7876eb349583f27f3;hpb=5b5853f5f58c84f89e2edfc90805e658e188cd31;p=sbcl.git diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 447639e..46a36a8 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -1718,5 +1718,63 @@ (shared-initialize x '(a)) (assert (slot-boundp x 'a)) (assert (eq :ok (slot-value x 'a))))) + +(declaim (ftype (function (t t t) (values single-float &optional)) + i-dont-want-to-be-clobbered-1 + i-dont-want-to-be-clobbered-2)) +(defgeneric i-dont-want-to-be-clobbered-1 (t t t)) +(defmethod i-dont-want-to-be-clobbered-2 ((x cons) y z) + y) +(defun i-cause-an-gf-info-update () + (i-dont-want-to-be-clobbered-2 t t t)) +(with-test (:name :defgeneric-should-clobber-ftype) + ;; (because it doesn't check the argument or result types) + (assert (equal '(function (t t t) *) + (sb-kernel:type-specifier + (sb-int:info :function + :type 'i-dont-want-to-be-clobbered-1)))) + (assert (equal '(function (t t t) *) + (sb-kernel:type-specifier + (sb-int:info :function + :type 'i-dont-want-to-be-clobbered-2)))) + (assert (eq :defined-method + (sb-int:info :function + :where-from 'i-dont-want-to-be-clobbered-1))) + (assert (eq :defined-method + (sb-int:info :function + :where-from 'i-dont-want-to-be-clobbered-2)))) + +(with-test (:name :bogus-parameter-specializer-name-error) + (assert (eq :ok + (handler-case + (eval `(defmethod #:fii ((x "a string")) 'string)) + (sb-int:reference-condition (c) + (when (member '(:ansi-cl :macro defmethod) + (sb-int:reference-condition-references c) + :test #'equal) + :ok)))))) + +(defclass remove-default-initargs-test () + ((x :initarg :x :initform 42))) +(defclass remove-default-initatgs-test () + ((x :initarg :x :initform 42)) + (:default-initargs :x 0)) +(defclass remove-default-initargs-test () + ((x :initarg :x :initform 42))) +(with-test (:name :remove-default-initargs) + (assert (= 42 (slot-value (make-instance 'remove-default-initargs-test) + 'x)))) +(with-test (:name :bug-485019) + ;; there was a bug in WALK-SETQ, used in method body walking, in the + ;; presence of declarations on symbol macros. + (defclass bug-485019 () + ((array :initarg :array))) + (defmethod bug-485019 ((bug-485019 bug-485019)) + (with-slots (array) bug-485019 + (declare (type (or null simple-array) array)) + (setf array (make-array 4))) + bug-485019) + (bug-485019 (make-instance 'bug-485019))) + ;;;; success