Skip to content

Commit 2c79e9d

Browse files
committed
patch 8.2.1344: Vim9: No test for trying to redefine global function
Problem: Vim9: No test for trying to redefine global function. Solution: Add a test.
1 parent 333894b commit 2c79e9d

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/testdir/test_vim9_func.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,19 @@ def Test_nested_global_function()
159159
delfunc g:Inner
160160
END
161161
CheckScriptSuccess(lines)
162+
163+
lines =<< trim END
164+
vim9script
165+
def Outer()
166+
def g:Inner(): string
167+
return 'inner'
168+
enddef
169+
enddef
170+
defcompile
171+
Outer()
172+
Outer()
173+
END
174+
CheckScriptFailure(lines, "E122:")
162175
enddef
163176

164177
def Test_global_local_function()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1344,
757759
/**/
758760
1343,
759761
/**/

0 commit comments

Comments
 (0)