1
0
forked from aniani/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 #8302)
This commit is contained in:
Bram Moolenaar
2021-06-01 21:21:55 +02:00
parent 6a43b37b76
commit 6f1d2aa437
5 changed files with 28 additions and 6 deletions

View File

@@ -2686,6 +2686,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