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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202012082110.0B8LAbBA1742674%40masaka.moolenaar.net.

Raspunde prin e-mail lui