Bad special case with *derive-function-types* t

Bug #1682190 reported by Philipp Marek on 2017-04-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

Here's a small testcase that is broken currently.

Basically, returning (values) should be compatible with (member t nil), as "no value" is as good as "NIL".

ogamita on #lisp acknowledged that it looks like a bug.

Here's the test:

(declaim (ftype (function () (values (member t nil) &optional)) values-is-a-boolean-return))
(test-util:with-test (:name :values-is-a-boolean-return)
(let* ((*evaluator-mode* :compile)
       (*derive-function-types* t)
       (compiler-result
         (with-output-to-string (*error-output*)
           (eval `(progn
                    (defun values-is-a-boolean-return ()
                      (if (zerop (random 2))
                          (values)))))
           )))
  (assert (string= "" compiler-result))))

Stas Boukarev (stassats) wrote :

(values) returns zero values, while the declaration declares a single value, so they're not compatible.

Changed in sbcl:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers