bug#42757: calling internal define with incorrect n(args) gives invalid error

Christopher Lam <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <CAKVAZZJY0w_AKvrHj1tXzbs4PP3gOoL8TLNqNZnWak0zc7HUQw@mail.gmail.com>
Using guile 3.0.1 (also tested with 3.0.4)

Consider following snippet
------
(define (outer-function)
  (define (inner-function q w e r t y)  ;takes 6 args
    #f)
  (inner-function 'a 'b 'c 'd 'e))     ;send 5 args
(outer-function)
------

The internally defined function is called with insufficient args. We'd
expect error to be
"Wrong number of arguments to inner-function"

Instead the error is
"Wrong number of arguments to a"

Note if the invalid code is not internally-defined, the error is correct:
"Wrong number of arguments to #<procedure inner-function (q w e r t y)>"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.