[I already sent the report below to sbcl-bugs, but haven't received a confirmation yet - is that mailing list still monitored?]
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:%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
* (function-lambda-expression (constantly 42))
The lambda list for the function returned by constantly seems to be wrong, which should rather accept any number of arguments.
Pascal Costanza, mailto:pc@..., http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium