X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.impure.lisp;h=78d64161b4766b90b5c3407c4eaa6bc9abcd0557;hb=98c725660502dc1a761e60ac935f95ed60143021;hp=48b2028b81796af0708c9af9e0d86b1e7c0abb4b;hpb=f76b45e1a3bb2008540e0db90b591c591315f129;p=sbcl.git diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index 48b2028..78d6416 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -1361,4 +1361,26 @@ (assert (s368-p nsu)) (assert *h368-was-called-p*)) +;;; bug 367: array type intersections in the compiler +(defstruct e367) +(defstruct i367) +(defstruct g367 + (i367s (make-array 0 :fill-pointer t) :type (or (vector i367) null))) +(defstruct s367 + (g367 (error "missing :G367") :type g367 :read-only t)) +(declaim (ftype (function ((vector i367) e367) (or s367 null)) r367)) +(declaim (ftype (function ((vector e367)) (values)) h367)) +(defun frob-367 (v w) + (let ((x (g367-i367s (make-g367)))) + (let* ((y (or (r367 x w) + (h367 x))) + (z (s367-g367 y))) + (format t "~&Y=~S Z=~S~%" y z) + (g367-i367s z)))) +(defun r367 (x y) (declare (ignore x y)) nil) +(defun h367 (x) (declare (ignore x)) (values)) +(multiple-value-bind (res err) (ignore-errors (frob-367 0 (make-e367))) + (assert (not res)) + (assert (typep err 'type-error))) + ;;; success