To: vim_dev@googlegroups.com Subject: Patch 8.2.4312 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4312 Problem: No error for using :vim9script in a :def function. Solution: Give an error when compiling. Files: src/vim9compile.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.4311/src/vim9compile.c 2022-02-02 16:20:22.386554561 +0000 --- src/vim9compile.c 2022-02-06 17:26:37.385862818 +0000 *************** *** 3138,3143 **** --- 3138,3147 ---- 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; *** ../vim-8.2.4311/src/testdir/test_vim9_script.vim 2022-02-04 21:58:53.437278804 +0000 --- src/testdir/test_vim9_script.vim 2022-02-06 17:15:09.218741264 +0000 *************** *** 1227,1232 **** --- 1227,1233 ---- v9.CheckScriptFailure(['vim9script', 'const str = "asdf"', 'str = "xxx"'], 'E46:') assert_fails('vim9script', 'E1038:') + v9.CheckDefFailure(['vim9script'], 'E1038:') enddef def Test_script_var_shadows_function() *** ../vim-8.2.4311/src/version.c 2022-02-06 17:16:57.730598839 +0000 --- src/version.c 2022-02-06 17:27:28.773823785 +0000 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4312, /**/ -- hundred-and-one symptoms of being an internet addict: 14. You start introducing yourself as "Jim at I-I-Net dot net dot au" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///