patch 8.2.3869: Vim9: type checking for "any" is inconsistent
Problem: Vim9: type checking for "any" is inconsistent.
Solution: Always use a runtime type check for using "any" for a more
specific type.
diff --git a/src/vim9expr.c b/src/vim9expr.c
index 6fe8e2a..6a1faf8 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -415,7 +415,7 @@
// Global, Buffer-local, Window-local and Tabpage-local
// variables can be defined later, thus we don't check if it
// exists, give an error at runtime.
- res = generate_LOAD(cctx, isn_type, 0, name, &t_unknown);
+ res = generate_LOAD(cctx, isn_type, 0, name, &t_any);
}
}
}
@@ -2846,6 +2846,7 @@
type_T **typep;
generate_ppconst(cctx, ppconst);
+ ppconst->pp_is_const = FALSE;
// If the types differ, the result has a more generic type.
typep = ((type_T **)stack->ga_data) + stack->ga_len - 1;