Problem: Vim9: no error when assigning to script var with wrong type.
Solution: Fix off-by-one error. (closes #7028)
assert_equal(44, t)
END
CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ vim9script
+ var n: number
+ def Func()
+ n = 'string'
+ enddef
+ defcompile
+ END
+ CheckScriptFailure(lines, 'E1012: Type mismatch; expected number but got string')
enddef
def Mess(): string
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1764,
/**/
1763,
/**/
{
scriptvar_idx = get_script_item_idx(scriptvar_sid,
rawname, TRUE);
- if (scriptvar_idx > 0)
+ if (scriptvar_idx >= 0)
{
scriptitem_T *si = SCRIPT_ITEM(scriptvar_sid);
svar_T *sv =