1
0
forked from aniani/vim

patch 8.2.2918: builtin function can be shadowed by global variable

Problem:    Builtin function can be shadowed by global variable.
Solution:   Check for builtin function before variable. (Yasuhiro Matsumoto,
            closes #8302)
This commit is contained in:
Bram Moolenaar
2021-05-31 22:15:26 +02:00
parent bb162367ac
commit 3d9c4eefe6
3 changed files with 17 additions and 0 deletions

View File

@@ -2681,4 +2681,12 @@ func Test_gettext()
call assert_fails('call gettext(1)', 'E475:')
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:')
endfunc
" vim: shiftwidth=2 sts=2 expandtab