diff src/testdir/test_vim9_assign.vim @ 24717:bf8feac8a89a v8.2.2897

patch 8.2.2897: Vim9: can use reserved words at the script level Commit: https://github.com/vim/vim/commit/d0edaf9dc253e619ccc321ceaac321aee11c1ea5 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 28 21:06:08 2021 +0200 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 https://github.com/vim/vim/issues/8253)
author Bram Moolenaar <Bram@vim.org>
date Fri, 28 May 2021 21:15:03 +0200
parents 83877a1b66fd
children b6ac4ed5e2d2
line wrap: on
line diff
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -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 []