patch 8.2.0469: Vim9: no error for missing ] after list

Problem:    Vim9: no error for missing ] after list.
Solution:   Add error message. Add more tests.
diff --git a/src/globals.h b/src/globals.h
index f1538d6..290f07d 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1644,6 +1644,7 @@
 EXTERN char e_dictkey[]		INIT(= N_("E716: Key not present in Dictionary: %s"));
 EXTERN char e_listreq[]		INIT(= N_("E714: List required"));
 EXTERN char e_listblobreq[]	INIT(= N_("E897: List or Blob required"));
+EXTERN char e_list_end[]	INIT(= N_("E697: Missing end of List ']': %s"));
 EXTERN char e_listdictarg[]	INIT(= N_("E712: Argument of %s must be a List or Dictionary"));
 EXTERN char e_listdictblobarg[]	INIT(= N_("E896: Argument of %s must be a List, Dictionary or Blob"));
 EXTERN char e_modulus[]		INIT(= N_("E804: Cannot use '%' with Float"));
diff --git a/src/list.c b/src/list.c
index 518423b..918626e 100644
--- a/src/list.c
+++ b/src/list.c
@@ -1083,7 +1083,7 @@
     if (**arg != ']')
     {
 	if (do_error)
-	    semsg(_("E697: Missing end of List ']': %s"), *arg);
+	    semsg(_(e_list_end), *arg);
 failret:
 	if (evaluate)
 	    list_free(l);
diff --git a/src/testdir/test_lambda.vim b/src/testdir/test_lambda.vim
index 7fdfb87..bc3d5ac 100644
--- a/src/testdir/test_lambda.vim
+++ b/src/testdir/test_lambda.vim
@@ -62,7 +62,7 @@
 function Test_lambda_fails()
   call assert_equal(3, {a, b -> a + b}(1, 2))
   call assert_fails('echo {a, a -> a + a}(1, 2)', 'E853:')
-  call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E15:')
+  call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E451:')
   echo assert_fails('echo 10->{a -> a + 2}', 'E107:')
 endfunc
 
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index c9d5024..93626d5 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -806,6 +806,12 @@
   call CheckDefFailure("let x = @", "E1002:")
   call CheckDefFailure("let x = @<", "E354:")
 
+  call CheckDefFailure("let x = [1, 2", "E697:")
+  call CheckDefFailure("let x = [notfound]", "E1001:")
+
+  call CheckDefFailure("let x = { -> 123) }", "E451:")
+  call CheckDefFailure("let x = 123->{x -> x + 5) }", "E451:")
+
   call CheckDefFailure("let x = &notexist", 'E113:')
   call CheckDefExecFailure("&grepprg = [343]", 'E1051:')
 
@@ -878,6 +884,7 @@
 
 func Test_expr7_trailing_fails()
   call CheckDefFailureList(['let l = [2]', 'l->{l -> add(l, 8)}'], 'E107')
+  call CheckDefFailureList(['let l = [2]', 'l->{l -> add(l, 8)} ()'], 'E274')
 endfunc
 
 func Test_expr_fails()
diff --git a/src/userfunc.c b/src/userfunc.c
index 32b9fb5..05e5b7f 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -350,7 +350,10 @@
     e = *arg;
     *arg = skipwhite(*arg);
     if (**arg != '}')
+    {
+	semsg(_("E451: Expected }: %s"), *arg);
 	goto errret;
+    }
     ++*arg;
 
     if (evaluate)
diff --git a/src/version.c b/src/version.c
index a4ffae0..8bf06a1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    469,
+/**/
     468,
 /**/
     467,