call CheckDefFailure("let x = {'a': xxx}", 'E1001:')
call CheckDefFailure("let x = {xxx: 8}", 'E1001:')
call CheckDefFailure("let x = #{a: 1, a: 2}", 'E721:')
+ call CheckDefFailure("let x += 1", 'E1020:')
+ call CheckDefFailure("let x = x + 1", 'E1001:')
call CheckDefExecFailure("let x = g:anint.member", 'E715:')
call CheckDefExecFailure("let x = g:dict_empty.member", 'E716:')
enddef
}
else if (oplen > 0)
{
+ int r;
+
// for "+=", "*=", "..=" etc. first load the current value
if (*op != '=')
{
}
}
- // compile the expression
+ // Compile the expression. Temporarily hide the new local variable
+ // here, it is not available to this expression.
+ if (idx >= 0)
+ --cctx->ctx_locals.ga_len;
instr_count = instr->ga_len;
p = skipwhite(p + oplen);
- if (compile_expr1(&p, cctx) == FAIL)
+ r = compile_expr1(&p, cctx);
+ if (idx >= 0)
+ ++cctx->ctx_locals.ga_len;
+ if (r == FAIL)
goto theend;
if (idx >= 0 && (is_decl || !has_type))