comparison src/evalvars.c @ 20840:0600ab7b9f09 v8.2.0972

patch 8.2.0972: Vim9 script variable declarations need a type Commit: https://github.com/vim/vim/commit/c82a5b5da5eab15bc35115545b639fb590272ad7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 13 18:09:19 2020 +0200 patch 8.2.0972: Vim9 script variable declarations need a type Problem: Vim9 script variable declarations need a type. Solution: Make "let var: type" declare a script-local variable.
author Bram Moolenaar <Bram@vim.org>
date Sat, 13 Jun 2020 18:15:03 +0200
parents 9064044fd4f6
children bacc2ab11810
comparison
equal deleted inserted replaced
20839:7c1e92b152ed 20840:0600ab7b9f09
726 if (*arg == '[') 726 if (*arg == '[')
727 emsg(_(e_invarg)); 727 emsg(_(e_invarg));
728 else if (expr[0] == '.') 728 else if (expr[0] == '.')
729 emsg(_("E985: .= is not supported with script version 2")); 729 emsg(_("E985: .= is not supported with script version 2"));
730 else if (!ends_excmd2(eap->cmd, arg)) 730 else if (!ends_excmd2(eap->cmd, arg))
731 // ":let var1 var2" 731 {
732 arg = list_arg_vars(eap, arg, &first); 732 if (current_sctx.sc_version == SCRIPT_VERSION_VIM9)
733 {
734 // Vim9 declaration ":let var: type"
735 arg = vim9_declare_scriptvar(eap, arg);
736 }
737 else
738 {
739 // ":let var1 var2" - list values
740 arg = list_arg_vars(eap, arg, &first);
741 }
742 }
733 else if (!eap->skip) 743 else if (!eap->skip)
734 { 744 {
735 // ":let" 745 // ":let"
736 list_glob_vars(&first); 746 list_glob_vars(&first);
737 list_buf_vars(&first); 747 list_buf_vars(&first);