diff src/eval.c @ 23239:a789a688e37d v8.2.2165

patch 8.2.2165: Vim9: assignment to dict member does not work Commit: https://github.com/vim/vim/commit/8f22f5c3aa0aa96e3843a57f29405625d8514c74 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 19 22:10:13 2020 +0100 patch 8.2.2165: Vim9: assignment to dict member does not work Problem: Vim9: assignment to dict member does not work. Solution: Fix recognizing dict member. (closes https://github.com/vim/vim/issues/7484)
author Bram Moolenaar <Bram@vim.org>
date Sat, 19 Dec 2020 22:45:03 +0100
parents 657216220293
children 5b4db8035d1d
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -874,6 +874,13 @@ get_lval(
     if (v == NULL)
 	return NULL;
 
+    if (in_vim9script() && (flags & GLV_NO_DECL) == 0)
+    {
+	if (!quiet)
+	    semsg(_(e_variable_already_declared), lp->ll_name);
+	return NULL;
+    }
+
     /*
      * Loop until no more [idx] or .key is following.
      */