CONSTANTLY functions have bogus lambda-list and type
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)))))
See the following transcript:
; in: LAMBDA NIL
; (FUNCALL (TEST) 1 2 3)
; (SB-C::%FUNCALL (SB-KERNEL:
; caught WARNING:
; The function was called with three arguments, but wants exactly zero.
; compilation unit finished
; caught 1 WARNING condition
The lambda list for the function returned by constantly seems to be wrong, which should rather accept any number of arguments.