0.pre7.60:
[sbcl.git] / tests / compiler.pure-cload.lisp
index 8c7dd8e..279b850 100644 (file)
   (declare (type (mod 1000) a b))
   (let ((tmp (= 10 (+ (incf a) (incf a) (incf b) (incf b)))))
     (or tmp (error "TMP not true"))))
+
+;;; Exercise a (byte-)compiler bug by causing a call to ERROR, not
+;;; because the symbol isn't defined as a variable, but because
+;;;  TYPE-ERROR in SB-KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER:
+;;;     0 is not of type (OR FUNCTION SB-KERNEL:FDEFN).
+;;; Correct behavior is to warn at compile time because the symbol
+;;; isn't declared as a variable, but to set its SYMBOL-VALUE anyway.
+;;; 
+;;; This bug was in sbcl-0.6.11.13.
+(print (setq improperly-declared-var '(1 2)))
+(assert (equal (symbol-value 'improperly-declared-var) '(1 2)))
+(makunbound 'improperly-declared-var)
+;;; This is a slightly different way of getting the same symptoms out
+;;; of the sbcl-0.6.11.13 byte compiler bug.
+(print (setq *print-level* *print-level*))
+
+
+;;; sbcl-0.6.11.25 or so had DEF!STRUCT/MAKE-LOAD-FORM/HOST screwed up
+;;; so that the compiler couldn't dump pathnames.
+(format t "Now the compiler can dump pathnames again: ~S ~S~%" #p"" #p"/x/y/z")