Steel Bank Common Lisp

CONSTANTLY functions have bogus lambda-list and type

Reported by Nikodemus Siivola on 2011-02-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Medium
Nikodemus Siivola

Bug Description

Reported by Pascal Costanza on sbcl-bugs.

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.

Nikodemus Siivola (nikodemus) wrote :

Patch waiting for Sourceforge CVS to come up.

Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: Triaged → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers