To: vim_dev@googlegroups.com Subject: Patch 8.2.1286 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1286 Problem: Vim9: No error when using a type to a window variable Solution: Recognize the syntax and give an error. (closes #6521) Files: src/ex_docmd.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.1285/src/ex_docmd.c 2020-07-23 17:16:15.050100601 +0200 --- src/ex_docmd.c 2020-07-23 21:07:45.909495700 +0200 *************** *** 3324,3329 **** --- 3324,3337 ---- return eap->cmd; } } + + // Recognize using a type for a w:, b:, t: or g: variable: + // "w:varname: number = 123". + if (eap->cmd[1] == ':' && *p == ':') + { + eap->cmdidx = CMD_eval; + return eap->cmd; + } } #endif *** ../vim-8.2.1285/src/testdir/test_vim9_script.vim 2020-07-23 13:11:33.247754399 +0200 --- src/testdir/test_vim9_script.vim 2020-07-23 21:12:46.624346066 +0200 *************** *** 376,381 **** --- 376,390 ---- call assert_fails('s/^/\=Mess()/n', 'E794:') call CheckDefFailure(['let var: dict