To: vim_dev@googlegroups.com Subject: Patch 8.2.2115 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2115 Problem: Vim9: some errors not tested for; dead code. Solution: Add a test. Remove dead code. Files: src/vim9compile.c, src/testdir/test_vim9_assign.vim *** ../vim-8.2.2114/src/vim9compile.c 2020-12-08 21:53:24.297588897 +0100 --- src/vim9compile.c 2020-12-08 22:04:45.113473084 +0100 *************** *** 5705,5716 **** // without operator check type here, otherwise below if (has_index) - { use_type = member_type; - if (member_type == NULL) - // could be indexing "any" - use_type = &t_any; - } if (need_type(rhs_type, use_type, -1, cctx, FALSE, is_const) == FAIL) goto theend; --- 5705,5711 ---- *** ../vim-8.2.2114/src/testdir/test_vim9_assign.vim 2020-12-08 11:29:36.579249992 +0100 --- src/testdir/test_vim9_assign.vim 2020-12-08 22:08:12.204320678 +0100 *************** *** 1045,1050 **** --- 1045,1053 ---- s:name = 'prefixed' g:var_prefixed = s:name + const FOO: number = 123 + assert_equal(123, FOO) + var s:other: number other = 1234 g:other_var = other *************** *** 1087,1092 **** --- 1090,1099 ---- var 9var: string END CheckScriptFailure(lines, 'E475:') + + CheckDefFailure(['var foo.bar = 2'], 'E1087:') + CheckDefFailure(['var foo[3] = 2'], 'E1087:') + CheckDefFailure(['const foo: number'], 'E1021:') enddef def Test_var_type_check() *** ../vim-8.2.2114/src/version.c 2020-12-08 21:53:24.297588897 +0100 --- src/version.c 2020-12-08 22:00:55.790787391 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2115, /**/ -- Biting someone with your natural teeth is "simple assault," while biting someone with your false teeth is "aggravated assault." [real standing law in Louisana, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///