diff src/vim9compile.c @ 27738:d754ac2f5ac5 v8.2.4395

patch 8.2.4395: some code lines not covered by tests Commit: https://github.com/vim/vim/commit/8b716f5f2204f938769de283d43bcb2f77d403e7 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 15 21:17:56 2022 +0000 patch 8.2.4395: some code lines not covered by tests Problem: Some code lines not covered by tests. Solution: Add a few more test cases. Fix getting more than one error for invalid assignment.
author Bram Moolenaar <Bram@vim.org>
date Tue, 15 Feb 2022 22:30:04 +0100
parents fdc841530372
children 6e5d378919c4
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2420,7 +2420,7 @@ may_compile_assignment(exarg_T *eap, cha
 
     if (*eap->cmd == '[')
     {
-	// [var, var] = expr
+	// might be "[var, var] = expr"
 	*line = compile_assignment(eap->cmd, eap, CMD_SIZE, cctx);
 	if (*line == NULL)
 	    return FAIL;
@@ -2958,7 +2958,10 @@ compile_def_function(
 	    case CMD_decrement:
 		    line = compile_assignment(p, &ea, ea.cmdidx, &cctx);
 		    if (line == p)
+		    {
+			emsg(_(e_invalid_assignment));
 			line = NULL;
+		    }
 		    break;
 
 	    case CMD_unlet: