summaryrefslogtreecommitdiff
path: root/src/vim9expr.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-22 13:18:39 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-22 13:18:39 +0000
commitfa46ead31abe66494da775921feefece02ce6d95 (patch)
tree61932b619ca1b7c096e4001b23608652310970ea /src/vim9expr.c
parent1b5f7a6202406b7d7ac804960602350e42b8be80 (diff)
downloadvim-git-fa46ead31abe66494da775921feefece02ce6d95.tar.gz
patch 8.2.3869: Vim9: type checking for "any" is inconsistentv8.2.3869
Problem: Vim9: type checking for "any" is inconsistent. Solution: Always use a runtime type check for using "any" for a more specific type.
Diffstat (limited to 'src/vim9expr.c')
-rw-r--r--src/vim9expr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vim9expr.c b/src/vim9expr.c
index 6fe8e2af1..6a1faf839 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -415,7 +415,7 @@ compile_load(
// 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 @@ compile_expr1(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
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;