summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_vim9_assign.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 03:56:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 03:56:56 +0000
commit75a9fa68f6cdd6769813a8c5e055bfb00a08c089 (patch)
treedaf1676b4e5ea491b7a370467a24b8181cc21827 /src/testdir/test_vim9_assign.vim
parentAdding upstream version 2:9.1.0377. (diff)
downloadvim-upstream/2%9.1.0496.tar.xz
vim-upstream/2%9.1.0496.zip
Adding upstream version 2:9.1.0496.upstream/2%9.1.0496
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/testdir/test_vim9_assign.vim')
-rw-r--r--src/testdir/test_vim9_assign.vim14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim
index 4296c37..bb08943 100644
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -650,7 +650,7 @@ def Test_assign_index()
var bl = 0z11
bl[1] = g:val
END
- v9.CheckDefExecAndScriptFailure(lines, 'E1030: Using a String as a Number: "22"')
+ v9.CheckDefExecAndScriptFailure(lines, ['E1030: Using a String as a Number: "22"', 'E1012: Type mismatch; expected number but got string'])
# should not read the next line when generating "a.b"
var a = {}
@@ -3687,4 +3687,16 @@ def Test_final_var_with_blob_value()
v9.CheckScriptSuccess(lines)
enddef
+" Test for overwriting a script-local function using the s: dictionary
+def Test_override_script_local_func()
+ var lines =<< trim END
+ vim9script
+ def MyFunc()
+ enddef
+ var d: dict<any> = s:
+ d.MyFunc = function('min')
+ END
+ v9.CheckScriptFailure(lines, 'E705: Variable name conflicts with existing function: MyFunc', 5)
+enddef
+
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker