1
0
forked from aniani/vim

patch 8.2.3866: Vim9: type checking global variables is inconsistent

Problem:    Vim9: type checking global variables is inconsistent.
Solution:   Use the "unknown" type in more places.
This commit is contained in:
Bram Moolenaar
2021-12-21 12:32:17 +00:00
parent 0d807107b6
commit 59618fed4c
7 changed files with 121 additions and 36 deletions

View File

@@ -843,8 +843,11 @@ compile_for(char_u *arg_start, cctx_T *cctx)
// If we know the type of "var" and it is a not a supported type we can
// give an error now.
vartype = ((type_T **)stack->ga_data)[stack->ga_len - 1];
if (vartype->tt_type != VAR_LIST && vartype->tt_type != VAR_STRING
&& vartype->tt_type != VAR_BLOB && vartype->tt_type != VAR_ANY)
if (vartype->tt_type != VAR_LIST
&& vartype->tt_type != VAR_STRING
&& vartype->tt_type != VAR_BLOB
&& vartype->tt_type != VAR_ANY
&& vartype->tt_type != VAR_UNKNOWN)
{
semsg(_(e_for_loop_on_str_not_supported),
vartype_name(vartype->tt_type));