Mercurial > vim
diff src/vim9expr.c @ 26680:1b288eb2fcdc v8.2.3869
patch 8.2.3869: Vim9: type checking for "any" is inconsistent
Commit: https://github.com/vim/vim/commit/fa46ead31abe66494da775921feefece02ce6d95
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Dec 22 13:18:39 2021 +0000
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 22 Dec 2021 14:30:05 +0100 |
parents | 38a270fdd3f6 |
children | 30972227ac8d |
line wrap: on
line diff
--- 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 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;