comparison src/testdir/test_vim9_assign.vim @ 23138:1a9705075244 v8.2.2115

patch 8.2.2115: Vim9: some errors not tested for; dead code Commit: https://github.com/vim/vim/commit/7257af477bc5f33153f8f700b643551525f1105b Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 8 22:08:51 2020 +0100 patch 8.2.2115: Vim9: some errors not tested for; dead code Problem: Vim9: some errors not tested for; dead code. Solution: Add a test. Remove dead code.
author Bram Moolenaar <Bram@vim.org>
date Tue, 08 Dec 2020 22:15:04 +0100
parents f8cd5a5e03c4
children 055fa9db6f39
comparison
equal deleted inserted replaced
23137:d9bcd21008bb 23138:1a9705075244
1043 g:var_test = name 1043 g:var_test = name
1044 # prefixing s: is optional 1044 # prefixing s: is optional
1045 s:name = 'prefixed' 1045 s:name = 'prefixed'
1046 g:var_prefixed = s:name 1046 g:var_prefixed = s:name
1047 1047
1048 const FOO: number = 123
1049 assert_equal(123, FOO)
1050
1048 var s:other: number 1051 var s:other: number
1049 other = 1234 1052 other = 1234
1050 g:other_var = other 1053 g:other_var = other
1051 1054
1052 # type is inferred 1055 # type is inferred
1085 lines =<< trim END 1088 lines =<< trim END
1086 vim9script 1089 vim9script
1087 var 9var: string 1090 var 9var: string
1088 END 1091 END
1089 CheckScriptFailure(lines, 'E475:') 1092 CheckScriptFailure(lines, 'E475:')
1093
1094 CheckDefFailure(['var foo.bar = 2'], 'E1087:')
1095 CheckDefFailure(['var foo[3] = 2'], 'E1087:')
1096 CheckDefFailure(['const foo: number'], 'E1021:')
1090 enddef 1097 enddef
1091 1098
1092 def Test_var_type_check() 1099 def Test_var_type_check()
1093 var lines =<< trim END 1100 var lines =<< trim END
1094 vim9script 1101 vim9script