diff --git a/src/compiler/locall.lisp b/src/compiler/locall.lisp index 97372d3..2abd769 100644 --- a/src/compiler/locall.lisp +++ b/src/compiler/locall.lisp @@ -506,7 +506,14 @@ :format-control "function called with ~R argument~:P, but wants exactly ~R" :format-arguments (list n-call-args nargs)) - (setf (basic-combination-kind call) :error))))) + (with-ir1-environment-from-node call + (transform-call call + `(lambda (&rest args) + (declare (ignore args)) + (%verify-arg-count ',n-call-args + ',nargs)) + (or (combination-fun-source-name call nil) + 'arg-count-error))))))) ;;;; &OPTIONAL, &MORE and &KEYWORD calls