patch 8.2.4312: no error for using :vim9script in a :def function
Problem: No error for using :vim9script in a :def function.
Solution: Give an error when compiling.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 9dbd119..0bf47e2 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3138,6 +3138,10 @@
line = compile_script(line, &cctx);
break;
+ case CMD_vim9script:
+ emsg(_(e_vim9script_can_only_be_used_in_script));
+ goto erret;
+
case CMD_global:
if (check_global_and_subst(ea.cmd, p) == FAIL)
goto erret;