red icon indicating copy to clipboard operation
red copied to clipboard

`local` doesn't get reported in the stack trace

Open hiiamboris opened this issue 4 years ago • 2 comments

Describe the bug

>> f: does [oabfoaw]

>> g: func [/x] [x: :f  x]
== func [/x][x: :f x]
>> g
*** Script Error: oabfoaw has no value
*** Where: x
*** Stack: g x             ;) notice 'x'

>> g: func [/local] [local: :f  local]
== func [/local][local: :f local]
>> g
*** Script Error: oabfoaw has no value
*** Where: local
*** Stack: g              ;) notice no 'local'

Expected behavior

*** Stack: g local

Platform version

Red 0.6.4 for Windows built 6-Nov-2021/19:36:18+03:00  commit #30e5312

hiiamboris avatar Nov 25 '21 16:11 hiiamboris

x is not reported in the stack trace in the current commit:

>> f: does [oabfoaw]
== func [][oabfoaw]
>>  g: func [/x] [x: :f  x]
== func [/x][x: :f x]
>> g
*** Script Error: oabfoaw has no value
*** Where: x
*** Near : oabfoaw
*** Stack: g  

>>  g: func [/local] [local: :f  local]
== func [/local][local: :f local]
>> g
*** Script Error: oabfoaw has no value
*** Where: local
*** Near : oabfoaw
*** Stack: g  

dockimbel avatar Feb 09 '22 16:02 dockimbel

But this is the opposite of what I expected :) Now not only local but all local words disappear from the stack, making it harder to figure out what's happening, esp. on recursive calls.

>> f: does [oabfoaw]
>> g: does [f]
>> h: func [/x] [x: :g x]
>> h
*** Script Error: oabfoaw has no value
*** Where: f
*** Near : oabfoaw
*** Stack: h f     ;) where is x (aka g)?

hiiamboris avatar Feb 09 '22 17:02 hiiamboris