diff src/vim9compile.c @ 19455:655631882288 v8.2.0285

patch 8.2.0285: unused error message; cannot create s:var Commit: https://github.com/vim/vim/commit/0bbf722aaaa75b1bbe87ef6afc44c5fff8e3893b Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 19 22:31:48 2020 +0100 patch 8.2.0285: unused error message; cannot create s:var Problem: Unused error message. Cannot create s:var. Solution: Remove the error message. Make assignment to s:var work.
author Bram Moolenaar <Bram@vim.org>
date Wed, 19 Feb 2020 22:45:03 +0100
parents 12a2df388bca
children 08ef11a81daa
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3284,10 +3284,9 @@ compile_assignment(char_u *arg, exarg_T 
 		}
 	    }
 	}
-	else if ((STRNCMP(arg, "s:", 2) == 0
-		    ? lookup_script(arg + 2, varlen - 2)
-		    : lookup_script(arg, varlen)) == OK
-				   || find_imported(arg, varlen, cctx) != NULL)
+	else if (STRNCMP(arg, "s:", 2) == 0
+		|| lookup_script(arg, varlen) == OK
+		|| find_imported(arg, varlen, cctx) != NULL)
 	{
 	    dest = dest_script;
 	    if (is_decl)
@@ -3566,7 +3565,7 @@ compile_assignment(char_u *arg, exarg_T 
 		idx = get_script_item_idx(sid, rawname, TRUE);
 		// TODO: specific type
 		if (idx < 0)
-		    generate_OLDSCRIPT(cctx, ISN_STORES, rawname, sid, &t_any);
+		    generate_OLDSCRIPT(cctx, ISN_STORES, name, sid, &t_any);
 		else
 		    generate_VIM9SCRIPT(cctx, ISN_STORESCRIPT,
 							     sid, idx, &t_any);