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:
@@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user