Mercurial > vim
comparison src/testdir/test_functions.vim @ 24760:ca0f983f08cf v8.2.2918
patch 8.2.2918: builtin function can be shadowed by global variable
Commit: https://github.com/vim/vim/commit/3d9c4eefe656ee8bf58c0496a48bd56bac180056
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 31 22:15:26 2021 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 31 May 2021 22:30:02 +0200 |
parents | 13efbfc53054 |
children | 3907cf9be745 |
comparison
equal
deleted
inserted
replaced
24759:7603f2a9f1aa | 24760:ca0f983f08cf |
---|---|
2679 " Test for gettext() | 2679 " Test for gettext() |
2680 func Test_gettext() | 2680 func Test_gettext() |
2681 call assert_fails('call gettext(1)', 'E475:') | 2681 call assert_fails('call gettext(1)', 'E475:') |
2682 endfunc | 2682 endfunc |
2683 | 2683 |
2684 func Test_builtin_check() | |
2685 call assert_fails('let g:["trim"] = {x -> " " .. x}', 'E704:') | |
2686 call assert_fails('let g:.trim = {x -> " " .. x}', 'E704:') | |
2687 call assert_fails('let s:["trim"] = {x -> " " .. x}', 'E704:') | |
2688 call assert_fails('let s:.trim = {x -> " " .. x}', 'E704:') | |
2689 endfunc | |
2690 | |
2691 | |
2684 " vim: shiftwidth=2 sts=2 expandtab | 2692 " vim: shiftwidth=2 sts=2 expandtab |