]> granicus.if.org Git - vim/commitdiff
patch 8.2.1344: Vim9: No test for trying to redefine global function v8.2.1344
authorBram Moolenaar <Bram@vim.org>
Sat, 1 Aug 2020 16:57:52 +0000 (18:57 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 1 Aug 2020 16:57:52 +0000 (18:57 +0200)
Problem:    Vim9: No test for trying to redefine global function.
Solution:   Add a test.

src/testdir/test_vim9_func.vim
src/version.c

index 3acae98ea9ddb599fac9fcdaf8aa96cb95df07f2..85fd8ff4e0acd527d9c70004d41e290fb07ff699 100644 (file)
@@ -159,6 +159,19 @@ def Test_nested_global_function()
       delfunc g:Inner
   END
   CheckScriptSuccess(lines)
+
+  lines =<< trim END
+      vim9script
+      def Outer()
+          def g:Inner(): string
+              return 'inner'
+          enddef
+      enddef
+      defcompile
+      Outer()
+      Outer()
+  END
+  CheckScriptFailure(lines, "E122:")
 enddef
 
 def Test_global_local_function()
index 33274ac62fab5254f831a4ffd2750895ec1f1341..c6b6e8fd0236d029d8cfe7299494cf74468f592a 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1344,
 /**/
     1343,
 /**/