ashinn / chibi-scheme

Official chibi-scheme repository
Other
1.22k stars 141 forks source link

More incomplete stack traces [2] #853

Open dpapavas opened 2 years ago

dpapavas commented 2 years ago

This may be related, or the same as, #835. I notice that running the following code

(let ((a (+ 1 "a")))
  (display a)
  (newline))

the resulting exception does have correct source location information set, but the stack frame is missing the relevant frame. I get:

$ chibi-scheme -xchibi -T test.scm
ERROR on line 1 of file test.scm: invalid type, expected Number: "a"
  called from <anonymous> on line 1268 of file /usr/local/share/chibi/init-7.scm
  called from <anonymous> on line 800 of file /usr/local/share/chibi/init-7.scm

On the other hand, if the error is inside the let body, e.g.

(let ((a 1))
  (display (+ 1 "a"))
  (newline))

the stack frame is complete:

$ chibi-scheme -xchibi -T test.scm
ERROR on line 1 of file test.scm: invalid type, expected Number: "a"
  called from <anonymous> on line 1 of file test.scm
  called from <anonymous> on line 1268 of file /usr/local/share/chibi/init-7.scm
  called from <anonymous> on line 800 of file /usr/local/share/chibi/init-7.scm
ashinn commented 2 years ago

Will take a look. Note your title is also "incoplete" :)

dpapavas commented 2 years ago

Note your title is also "incoplete" :)

:laughing: Noted and corrected.