vim-patch:8.1.0897: can modify a:000 when using a reference (#14902)

Problem:    Can modify a:000 when using a reference.
Solution:   Make check for locked variable stricter. (Ozaki Kiichi,
            closes vim/vim#3930)
05c00c038b
This commit is contained in:
Jan Edmund Lazo
2021-06-26 10:19:09 -04:00
committed by GitHub
parent ad9c2c069a
commit 20dc3f1989
6 changed files with 85 additions and 54 deletions

View File

@@ -126,10 +126,15 @@ endfunction
func s:set_varg7(...) abort
let b = a:000
call add(b, 1)
let b += [1]
endfunction
func s:set_varg8(...) abort
let b = a:000
call add(b, 1)
endfunction
func s:set_varg9(...) abort
let b = a:000
let b[0][0] = 1
endfunction
@@ -142,7 +147,8 @@ func Test_let_varg_fail()
call s:set_varg5([0])
call assert_fails('call s:set_varg6(1)', 'E742:')
call assert_fails('call s:set_varg7(1)', 'E742:')
call s:set_varg8([0])
call assert_fails('call s:set_varg8(1)', 'E742:')
call s:set_varg9([0])
endfunction
func Test_let_utf8_environment()