From: Paul K. <pk...@us...> - 2010-04-27 16:19:33
|
Update of /cvsroot/sbcl/sbcl/tests In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv6264/tests Modified Files: compiler.impure.lisp Log Message: 1.0.37.73: Remove the one place we assumed constant LVARs referred literals * Resulted in a type mismatch or subtle errors during compilation with singleton types. Reported by Chun Tian (binghe) on sbcl-devel Index: compiler.impure.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/tests/compiler.impure.lisp,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- compiler.impure.lisp 23 Mar 2010 17:52:10 -0000 1.115 +++ compiler.impure.lisp 27 Apr 2010 16:19:23 -0000 1.116 @@ -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 |