lambda list of CONSTANTLY seems to be wrong; spurious warning

Bug #696878 reported by Attila Lendvai on 2011-01-03
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

as reported by Pascal Costanza on sbcl-devel:

I have just discovered a bug that was revealed in 1.0.44 and 1.0.45, probably due to the changes in validate-call-type.

The following code emits a spurious warning:

(defvar *test* (constantly 42))

(defmacro test () *test*)

(defun run ()
 (let ((fun (compile nil `(lambda () (funcall (test) 1 2 3)))))
  (funcall fun)))

See the following transcript:

* (run)
; in: LAMBDA NIL
; (FUNCALL (TEST) 1 2 3)
; ==>
; (SB-C::%FUNCALL (SB-KERNEL:%COERCE-CALLABLE-TO-FUN (TEST)) 1 2 3)
;
; caught WARNING:
; The function was called with three arguments, but wants exactly zero.
;
; compilation unit finished
; caught 1 WARNING condition

42

* (function-lambda-expression (constantly 42))

NIL
T
(LAMBDA ())

The lambda list for the function returned by constantly seems to be wrong, which should rather accept any number of arguments.

Paul Khuong (pvk) wrote :

    ;; KLUDGE: This declaration is a hack to make the closure ignore
    ;; all its arguments without consing a &REST list or anything.
    ;; Perhaps once DYNAMIC-EXTENT is implemented we won't need to
    ;; screw around with this kind of thing. -- WHN 2001-04-06

Right.

Changed in sbcl:
status: New → Confirmed
assignee: nobody → Paul Khuong (pvk)
Nikodemus Siivola (nikodemus) wrote :

In 1.0.45.17.

Changed in sbcl:
assignee: Paul Khuong (pvk) → nobody
status: Confirmed → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers