]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0814: Vim9: E1041 when reloading an autoload script with exported variables v9.2.0814
authorHirohito Higashi <h.east.727@gmail.com>
Mon, 20 Jul 2026 16:47:57 +0000 (16:47 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 20 Jul 2026 16:51:04 +0000 (16:51 +0000)
commitcf80f134e95ead988b875e8c21813104f2575390
tree66c5add02164161f5cccc11b1d014028c611e9e4
parent4a403b48c653461f3c2fa331664d68585f59ea4c
patch 9.2.0814: Vim9: E1041 when reloading an autoload script with exported variables

Problem:  Sourcing a Vim9 autoload script more than once fails with E1041
          for its exported variables and constants, while exported functions
          reload without error (ubaldot)
Solution: Give exported variables and constants the same clean slate as
          functions on reload by removing them from the global namespace, so
          the script body can define them again.  Keep classes and enums:
          objects created from the previous definition still refer to it, so
          they are not redefined this way (Hirohito Higashi)

fixes:  #19205
closes: #20726

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/vim9.txt
src/evalvars.c
src/proto/evalvars.pro
src/testdir/test_vim9_import.vim
src/version.c
src/vim9script.c