Problem: Vim9: some errors not tested for; dead code.
Solution: Add a test. Remove dead code.
s:name = 'prefixed'
g:var_prefixed = s:name
+ const FOO: number = 123
+ assert_equal(123, FOO)
+
var s:other: number
other = 1234
g:other_var = other
var 9var: string
END
CheckScriptFailure(lines, 'E475:')
+
+ CheckDefFailure(['var foo.bar = 2'], 'E1087:')
+ CheckDefFailure(['var foo[3] = 2'], 'E1087:')
+ CheckDefFailure(['const foo: number'], 'E1021:')
enddef
def Test_var_type_check()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2115,
/**/
2114,
/**/
// without operator check type here, otherwise below
if (has_index)
- {
use_type = member_type;
- if (member_type == NULL)
- // could be indexing "any"
- use_type = &t_any;
- }
if (need_type(rhs_type, use_type, -1, cctx,
FALSE, is_const) == FAIL)
goto theend;