unrecognized mismatch between ftype declaim and lambda-list

Bug #458354 reported by Tobias C. Rittweiler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Medium
Nikodemus Siivola

Bug Description

Compiling and loading

  (declaim (ftype
            (function
             (sequence unsigned-byte &key (:initial-element t)
                                          (:initial-contents sequence))
             (values sequence &optional))
            make-sequence-like))
  (locally
      (declare (sb-ext:muffle-conditions style-warning))
    (defun make-sequence-like
        (sequence length
         &rest keys
         &key (initial-element nil iep) (initial-contents nil icp))
      "returns a new sequence of length `length' and of the same type as `sequence'.

  the parameters `initial-element' and `initial-contents' specify how the new
  sequence is supposed to be initialized. only one of them can be passed at a
  time.
  "
      (declare (sb-ext:unmuffle-conditions style-warning))
      (declare (ignorable keys initial-element iep initial-contents icp))
      (apply #'sb-sequence:make-sequence-like sequence length keys)))

and then trying to evaluate

  (make-sequence-like #(1 2) 1 :initial-element '(1 2))

results in the following error

  * (make-sequence-like #(1 2) 1 :initial-element '(1 2))

  debugger invoked on a TYPE-ERROR in thread #<THREAD "initial thread" RUNNING {A9939A9}>:
    The value T is not of type SEQUENCE.

  Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

  restarts (invokable by number or by possibly-abbreviated name):
    0: [ABORT] Exit debugger, returning to top level.

  (MAKE-SEQUENCE-LIKE #(1 2) 1 :INITIAL-ELEMENT (1 2))

  0] :backtrace

    0: (MAKE-SEQUENCE-LIKE #(1 2) 1 :INITIAL-ELEMENT (1 2))
    1: (SB-INT:SIMPLE-EVAL-IN-LEXENV
        (MAKE-SEQUENCE-LIKE #(1 2) 1 :INITIAL-ELEMENT '(1 2))
        #<NULL-LEXENV>)
    2: (INTERACTIVE-EVAL (MAKE-SEQUENCE-LIKE #(1 2) 1 :INITIAL-ELEMENT '(1 2))) [:EXTERNAL]
    3: (SB-IMPL::REPL-FUN NIL)
    4: ((LAMBDA ()))
    5: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE (LAMBDA #) {AEB5E6D}>)
    6: (SB-IMPL::TOPLEVEL-REPL NIL)
    7: (SB-IMPL::TOPLEVEL-INIT)
    8: ((LABELS SB-IMPL::RESTART-LISP))

Tags: compiler-ir1
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

SBCL should complain about the &REST in the lambda-list at compile-time, yes.

Changed in sbcl:
status: New → Confirmed
importance: Undecided → Medium
tags: added: compiler-ir1
Changed in sbcl:
status: Confirmed → In Progress
assignee: nobody → Nikodemus Siivola (nikodemus)
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

In SBCL 1.0.36.33.

Changed in sbcl:
status: In Progress → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.