0.pre7.126:
[sbcl.git] / tests / loop.pure.lisp
index 46a38e8..66f7f34 100644 (file)
               (loop with (a . b) of-type float = '(0.0 . 1.0)
                     and (c . d) of-type float = '(2.0 . 3.0)
                     return (list a b c d))))
+
+;;; a bug reported and fixed by Alexey Dejneka sbcl-devel 2001-10-05:
+;;; The type declarations should apply, hence under Python's
+;;; declarations-are-assertions rule, the code should signal a type
+;;; error.
+(assert (typep (nth-value 1
+                         (ignore-errors
+                           (funcall (lambda ()
+                                      (loop with (a . b)
+                                            of-type float = '(5 . 5)
+                                            return (list a b))))))
+              'type-error))
+
+;;; bug 103, reported by Arthur Lemmens sbcl-devel 2001-05-05,
+;;; fixed by Alexey Dejneka patch sbcl-devel 2001-10-05:
+;;; LOOP syntax requires that forms after INITIALLY, FINALLY, and DO
+;;; must be compound forms.
+(multiple-value-bind (function warnings-p failure-p)
+    (compile nil
+            '(lambda ()
+               (loop while t do
+                     *print-level*
+                     (print t))))
+  (declare (ignore function warnings-p))
+  (assert failure-p))