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

@@ -404,9 +404,16 @@ EXTERN int garbage_collect_at_exit INIT(= FALSE);
// Commonly used types.
// "unknown" is used for when the type is really unknown, e.g. global
// variables. Also for when a function may or may not return something.
EXTERN type_T t_unknown INIT6(VAR_UNKNOWN, 0, 0, TTFLAG_STATIC, NULL, NULL);
// "any" is used for when the type is mixed. Excludes "void".
EXTERN type_T t_any INIT6(VAR_ANY, 0, 0, TTFLAG_STATIC, NULL, NULL);
// "void" is used for a function not returning anything.
EXTERN type_T t_void INIT6(VAR_VOID, 0, 0, TTFLAG_STATIC, NULL, NULL);
EXTERN type_T t_bool INIT6(VAR_BOOL, 0, 0, TTFLAG_STATIC, NULL, NULL);
EXTERN type_T t_special INIT6(VAR_SPECIAL, 0, 0, TTFLAG_STATIC, NULL, NULL);
EXTERN type_T t_number INIT6(VAR_NUMBER, 0, 0, TTFLAG_STATIC, NULL, NULL);