0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.2897: Vim9: can use reserved words at the script level

Problem:    Vim9: can use reserved words at the script level.
Solution:   Check variable names for reserved words. (closes #8253)
This commit is contained in:
Bram Moolenaar
2021-05-28 21:06:08 +02:00
parent dc3275a1ac
commit d0edaf9dc2
6 changed files with 39 additions and 19 deletions

View File

@@ -249,6 +249,13 @@ def Test_assignment()
END
enddef
def Test_reserved_name()
for name in ['true', 'false', 'null']
CheckDefExecAndScriptFailure(['var ' .. name .. ' = 0'], 'E1034:')
CheckDefExecAndScriptFailure(['var ' .. name .. ': bool'], 'E1034:')
endfor
enddef
def Test_skipped_assignment()
var lines =<< trim END
for x in []