X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.impure.lisp;h=99ba834b375739c932477a0540ea6fa960d86975;hb=f16e93459cd73b1884e3d576c95e422f8e8a000e;hp=8f9b132da7cebbc5a2827fc55f5780e2c96c7a16;hpb=736f5ba61a8a87df309df7c51b05f0a27f42df4c;p=sbcl.git diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index 8f9b132..99ba834 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -1944,4 +1944,21 @@ (setf *mystery* :mystery) (assert (eq :ok (test-mystery (make-thing :slot :mystery)))) +;;; Singleton types can also be constant. +(test-util:with-test (:name :propagate-singleton-types-to-eql) + (macrolet ((test (type value &aux (fun (gensym "FUN"))) + `(progn + (declaim (ftype (function () (values ,type &optional)) ,fun)) + (defun ,fun () + ',value) + (lambda (x) + (if (eql x (,fun)) + nil + (eql x (,fun))))))) + (values + (test (eql foo) foo) + (test (integer 0 0) 0) + (test (double-float 0d0 0d0) 0d0) + (test (eql #\c) #\c)))) + ;;; success