Hi,
[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)))))
(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.
Best,
Pascal
--
Pascal Costanza, mailto:pc@..., http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium
|