Problem: No error for using :vim9script in a :def function.
Solution: Give an error when compiling.
v9.CheckScriptFailure(['vim9script', 'const str = "asdf"', 'str = "xxx"'], 'E46:')
assert_fails('vim9script', 'E1038:')
+ v9.CheckDefFailure(['vim9script'], 'E1038:')
enddef
def Test_script_var_shadows_function()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4312,
/**/
4311,
/**/
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;