diff src/testdir/test_vim9_script.vim @ 21443:66386ca8a69f v8.2.1272

patch 8.2.1272: Vim9: type not checked if declaration also assigns value Commit: https://github.com/vim/vim/commit/4cdb13ce81309b62b636f2c614241959174d3fef Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 22 21:45:14 2020 +0200 patch 8.2.1272: Vim9: type not checked if declaration also assigns value Problem: Vim9: type not checked if declaration also assigns value. Solution: Check the type. (issue https://github.com/vim/vim/issues/6507)
author Bram Moolenaar <Bram@vim.org>
date Wed, 22 Jul 2020 22:00:04 +0200
parents 8ec9e2b54ce7
children 369cde0d5771
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -29,6 +29,9 @@ def Test_assignment()
   call CheckDefFailure(['let x:string = "x"'], 'E1069:')
   call CheckDefFailure(['let a:string = "x"'], 'E1069:')
 
+  let nr: number = 1234
+  call CheckDefFailure(['let nr: number = "asdf"'], 'E1013:')
+
   let a: number = 6 #comment
   assert_equal(6, a)