Incorrect type error in compiled code involving a CONS type

Bug #1795967 reported by Paul F. Dietz on 2018-10-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Low
Unassigned

Bug Description

(defun f316 ()
  (let* ((c1 (list 'x))
         (param (cons c1 0))
         (form
          `(lambda (p1)
             (the
              (cons
               (and
                (or (member a 3 ,c1) keyword)
                (or cons number (eql t)))
               number)
              p1))))
    (funcall (compile nil form) param)))

(f316) ==>

The value
  (#1=(X) . 0)
is not of type
  (CONS
   (OR (MEMBER #1#) (INTEGER 3 3)
       (AND (MEMBER T) (SATISFIES KEYWORDP)))
   NUMBER)
   [Condition of type TYPE-ERROR]

(but, of course, it is.)

Stas Boukarev (stassats) wrote :

Cause by

(typep (cons :y 10) '(not (cons (or (member :y) number (and (eql :x) keyword)) number)))
=> T.

because that type is negated into T.

tags: added: types
Changed in sbcl:
importance: Undecided → Low
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers