X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdefstruct.impure.lisp;h=e0ab36ed2dab1d35388d8651681e4fe96656d3dc;hb=5919ecc5fee77630855da6aeeabdc7d8cc4f2762;hp=04e3e1ca2fd2fb82b3b6537539cc50402f6e6f6e;hpb=14c8e1a7d219eaccf6657b3fa3f24de9a24717cb;p=sbcl.git diff --git a/tests/defstruct.impure.lisp b/tests/defstruct.impure.lisp index 04e3e1c..e0ab36e 100644 --- a/tests/defstruct.impure.lisp +++ b/tests/defstruct.impure.lisp @@ -1038,4 +1038,26 @@ redefinition." (assert-is pred1 instance) (assert-is pred2 instance))) - +(with-test (:name :raw-slot/circle-subst) + ;; CIRCLE-SUBSTS used %INSTANCE-REF on raw slots + (multiple-value-bind (list n) + (eval '(progn + (defstruct raw-slot/circle-subst + (x 0.0 :type single-float)) + (read-from-string "((#1=#S(raw-slot/circle-subst :x 2.7158911)))"))) + (destructuring-bind ((struct)) list + (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))))))