diff src/vim9compile.c @ 22415:1cefe1c013ac v8.2.1756

patch 8.2.1756: Vim9: :let will soon be disallowed Commit: https://github.com/vim/vim/commit/cfcd011fcd8021da52fba62dabf7a2497f1879b7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 27 15:19:27 2020 +0200 patch 8.2.1756: Vim9: :let will soon be disallowed Problem: Vim9: :let will soon be disallowed. Solution: Add v:disallow_let temporarily. Fix tests.
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Sep 2020 15:30:04 +0200
parents 66d1131a7eff
children 5b35b477eff0
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -6979,6 +6979,12 @@ compile_def_function(ufunc_T *ufunc, int
 		    break;
 
 	    case CMD_let:
+		    if (get_vim_var_nr(VV_DISALLOW_LET))
+		    {
+			emsg(_(e_cannot_use_let_in_vim9_script));
+			break;
+		    }
+		    // FALLTHROUGH
 	    case CMD_var:
 	    case CMD_final:
 	    case CMD_const: