X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdefstruct.impure.lisp;h=e84e4f3882a9f493cf4d6f647ffd7c102a74685b;hb=f16e93459cd73b1884e3d576c95e422f8e8a000e;hp=06a4b47ba70088fc252f9b1cca921197aa365dae;hpb=88dab5bc2cb92077bced88729dc95096b3b6a127;p=sbcl.git diff --git a/tests/defstruct.impure.lisp b/tests/defstruct.impure.lisp index 06a4b47..e84e4f3 100644 --- a/tests/defstruct.impure.lisp +++ b/tests/defstruct.impure.lisp @@ -1049,3 +1049,25 @@ redefinition." (assert (raw-slot/circle-subst-p struct)) (assert (eql 2.7158911 (raw-slot/circle-subst-x struct))) (assert (eql 45 n))))) + +(defstruct (bug-3b (:constructor make-bug-3b (&aux slot))) + (slot nil :type string)) + +(with-test (:name :bug-3b) + (handler-case + (progn + (bug-3b-slot (make-bug-3b)) + (error "fail")) + (type-error (e) + (assert (eq 'string (type-error-expected-type e))) + (assert (zerop (type-error-datum e)))))) + +(with-test (:name defstruct-copier-typechecks-argument) + (assert (not (raises-error? (copy-person (make-astronaut :name "Neil"))))) + (assert (raises-error? (copy-astronaut (make-person :name "Fred"))))) + +(with-test (:name :bug-528807) + (let ((*evaluator-mode* :compile)) + (handler-bind ((style-warning #'error)) + (eval `(defstruct (bug-528807 (:constructor make-528807 (&aux x))) + (x nil :type fixnum))))))