comparison src/testdir/test_vim9_script.vim @ 20842:bacc2ab11810 v8.2.0973

patch 8.2.0973: Vim9: type is not checked when assigning to a script variable Commit: https://github.com/vim/vim/commit/34db91f7a47b7bd4aabf1e1dfbaa8a08278bf78d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 13 19:00:10 2020 +0200 patch 8.2.0973: Vim9: type is not checked when assigning to a script variable Problem: Vim9: type is not checked when assigning to a script variable. Solution: Check the type.
author Bram Moolenaar <Bram@vim.org>
date Sat, 13 Jun 2020 19:15:03 +0200
parents 0600ab7b9f09
children 709379ab5110
comparison
equal deleted inserted replaced
20841:f0411e161f00 20842:bacc2ab11810
1829 1829
1830 unlet g:var_uninit 1830 unlet g:var_uninit
1831 unlet g:var_test 1831 unlet g:var_test
1832 enddef 1832 enddef
1833 1833
1834 def Test_let_type_check()
1835 let lines =<< trim END
1836 vim9script
1837 let var: string
1838 var = 1234
1839 END
1840 CheckScriptFailure(lines, 'E1013:')
1841 enddef
1842
1834 def Test_forward_declaration() 1843 def Test_forward_declaration()
1835 let lines =<< trim END 1844 let lines =<< trim END
1836 vim9script 1845 vim9script
1837 def GetValue(): string 1846 def GetValue(): string
1838 return theVal 1847 return theVal