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.
diff --git a/src/vim9cmds.c b/src/vim9cmds.c
index 6d8935a..5c7a938 100644
--- a/src/vim9cmds.c
+++ b/src/vim9cmds.c
@@ -843,8 +843,11 @@
// 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));