7c43588d
by Francis De Brabandere at 2026-05-21T22:27:32+02:00
vbscript: Check top-level name redefinition against global scope only.
compile_func() reuses ctx.dim_decls and ctx.const_decls to hold each
function's local declarations, so by the time a Sub, Function, or Class
name was checked for redefinition it was compared against whatever locals
the previously compiled procedure left behind, wrongly rejecting valid
code such as a local Dim that shadows a global Sub. Restore the global
declaration lists before each top-level check, and gate the Const-vs-Sub
check on global scope as the Dim path already does.