diff src/testdir/test_vim9_script.vim @ 25057:ffc3e1164652 v8.2.3065

patch 8.2.3065: Vim9: error when sourcing script twice and reusing function Commit: https://github.com/vim/vim/commit/577dc93da9ec78684576bff71328d40f24bd6dd8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 27 15:35:40 2021 +0200 patch 8.2.3065: Vim9: error when sourcing script twice and reusing function Problem: Vim9: error when sourcing script twice and reusing a function name. Solution: Check if the function is dead. (closes #8463)
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Jun 2021 15:45:03 +0200
parents faa3de7aed8b
children eac6e5a94e9d
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -1519,6 +1519,27 @@ def Test_vim9script_reload_noclear()
   delete('XExportReload')
   delfunc g:Values
   unlet g:loadCount
+
+  lines =<< trim END
+      vim9script
+      def Inner()
+      enddef
+  END
+  lines->writefile('XreloadScript.vim')
+  source XreloadScript.vim
+
+  lines =<< trim END
+      vim9script
+      def Outer()
+        def Inner()
+        enddef
+      enddef
+      defcompile
+  END
+  lines->writefile('XreloadScript.vim')
+  source XreloadScript.vim
+
+  delete('XreloadScript.vim')
 enddef
 
 def Test_vim9script_reload_import()