diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-06 07:01:45 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-06 10:01:50 +0800 |
commit | d4353c3645f294b67f5b30dae9f39de8f99c7413 (patch) | |
tree | 2fd4f4964889533fc9b72c98ad64d95a6cb70763 /src/nvim/testdir/test_functions.vim | |
parent | 4740672b37612004d559e9577ca87223ed49ec64 (diff) | |
download | rneovim-d4353c3645f294b67f5b30dae9f39de8f99c7413.tar.gz rneovim-d4353c3645f294b67f5b30dae9f39de8f99c7413.tar.bz2 rneovim-d4353c3645f294b67f5b30dae9f39de8f99c7413.zip |
vim-patch:9.0.0836: wrong error when using extend() with funcref
Problem: Wrong error when using extend() with funcref.
Solution: Better check the variable type. (closes vim/vim#11468, closes vim/vim#11455)
https://github.com/vim/vim/commit/91c75d18d9cdc32df57e648640de7476fbcb4d76
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index dbb39d0f23..743022ece4 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -2498,6 +2498,25 @@ func Test_builtin_check() let g:bar = 123 call extend(g:, #{bar: { -> "foo" }}, "keep") call assert_fails('call extend(g:, #{bar: { -> "foo" }}, "force")', 'E704:') + unlet g:bar + + call assert_fails('call extend(l:, #{foo: { -> "foo" }})', 'E704:') + let bar = 123 + call extend(l:, #{bar: { -> "foo" }}, "keep") + call assert_fails('call extend(l:, #{bar: { -> "foo" }}, "force")', 'E704:') + unlet bar + + call assert_fails('call extend(g:, #{foo: function("extend")})', 'E704:') + let g:bar = 123 + call extend(g:, #{bar: function("extend")}, "keep") + call assert_fails('call extend(g:, #{bar: function("extend")}, "force")', 'E704:') + unlet g:bar + + call assert_fails('call extend(l:, #{foo: function("extend")})', 'E704:') + let bar = 123 + call extend(l:, #{bar: function("extend")}, "keep") + call assert_fails('call extend(l:, #{bar: function("extend")}, "force")', 'E704:') + unlet bar endfunc |