aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-28 12:08:18 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-06 10:01:50 +0800
commit4740672b37612004d559e9577ca87223ed49ec64 (patch)
treec6fa7eb10e6b415d9e34b07e47df73febac31413 /src/nvim/testdir
parent6b3db3f92906b1c155b11f177c9378d9ff4d7d6b (diff)
downloadrneovim-4740672b37612004d559e9577ca87223ed49ec64.tar.gz
rneovim-4740672b37612004d559e9577ca87223ed49ec64.tar.bz2
rneovim-4740672b37612004d559e9577ca87223ed49ec64.zip
vim-patch:8.2.2921: E704 for script local variable is not backwards compatible
Problem: E704 for script local variable is not backwards compatible. (Yasuhiro Matsumoto) Solution: Only give the error in Vim9 script. Also check for function-local variable. https://github.com/vim/vim/commit/b54abeeafb074248597878a874fed9a66b114c06 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_functions.vim9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index 011e9e000e..dbb39d0f23 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -2486,8 +2486,13 @@ endfunc
func Test_builtin_check()
call assert_fails('let g:["trim"] = {x -> " " .. x}', 'E704:')
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('let l:["trim"] = {x -> " " .. x}', 'E704:')
+ call assert_fails('let l:.trim = {x -> " " .. x}', 'E704:')
+ let lines =<< trim END
+ vim9script
+ var s:trim = (x) => " " .. x
+ END
+ " call CheckScriptFailure(lines, 'E704:')
call assert_fails('call extend(g:, #{foo: { -> "foo" }})', 'E704:')
let g:bar = 123