changeset 21600:622021f43db1 v8.2.1350

patch 8.2.1350: Vim9: no test for error message when redefining function Commit: https://github.com/vim/vim/commit/b9a2cac3ef293bfdfe80dea6c6d16d02b7af5435 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 1 22:23:20 2020 +0200 patch 8.2.1350: Vim9: no test for error message when redefining function Problem: Vim9: no test for error message when redefining function. Solution: Add a test.
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Aug 2020 22:30:05 +0200
parents 322067462eaf
children 4f4faadeaa2a
files src/testdir/test_vim9_script.vim src/version.c
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -1651,6 +1651,19 @@ def Test_func_overrules_import_fails()
   delete('XexportedFunc.vim')
 enddef
 
+def Test_func_redefine_fails()
+  let lines =<< trim END
+    vim9script
+    def Func()
+      echo 'one'
+    enddef
+    def Func()
+      echo 'two'
+    enddef
+  END
+  CheckScriptFailure(lines, 'E1073:')
+enddef
+
 def Test_fixed_size_list()
   # will be allocated as one piece of memory, check that changes work
   let l = [1, 2, 3, 4]
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1350,
+/**/
     1349,
 /**/
     1348,