aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_functions.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-28 11:56:29 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-06 10:01:50 +0800
commit6b3db3f92906b1c155b11f177c9378d9ff4d7d6b (patch)
treefc9a1173623a96b95740434882dca480ce8f3272 /src/nvim/testdir/test_functions.vim
parent7683199a9bf5d84745a10222feddc43343410068 (diff)
downloadrneovim-6b3db3f92906b1c155b11f177c9378d9ff4d7d6b.tar.gz
rneovim-6b3db3f92906b1c155b11f177c9378d9ff4d7d6b.tar.bz2
rneovim-6b3db3f92906b1c155b11f177c9378d9ff4d7d6b.zip
vim-patch:8.2.2920: still a way to shadow a builtin function
Problem: Still a way to shadow a builtin function. (Yasuhiro Matsumoto) Solution: Check the key when using extend(). (issue vim/vim#8302) https://github.com/vim/vim/commit/6f1d2aa437744a7cb0206fdaa543a788c5a56c79 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r--src/nvim/testdir/test_functions.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index afeea20f2d..011e9e000e 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -2488,6 +2488,11 @@ func Test_builtin_check()
call assert_fails('let g:.trim = {x -> " " .. x}', 'E704:')
call assert_fails('let s:["trim"] = {x -> " " .. x}', 'E704:')
call assert_fails('let s:.trim = {x -> " " .. x}', 'E704:')
+
+ call assert_fails('call extend(g:, #{foo: { -> "foo" }})', 'E704:')
+ let g:bar = 123
+ call extend(g:, #{bar: { -> "foo" }}, "keep")
+ call assert_fails('call extend(g:, #{bar: { -> "foo" }}, "force")', 'E704:')
endfunc