diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-21 12:32:17 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-21 12:32:17 +0000 |
commit | 59618fed4ce118d12686c2e5c7c09601c8177817 (patch) | |
tree | 452cda2940d810a2b346826c09b8bd6c23952c6e /src/globals.h | |
parent | 0d807107b66e0d30d4f338c272962af5714c400e (diff) |
patch 8.2.3866: Vim9: type checking global variables is inconsistentv8.2.3866
Problem: Vim9: type checking global variables is inconsistent.
Solution: Use the "unknown" type in more places.
Diffstat (limited to 'src/globals.h')
-rw-r--r-- | src/globals.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/globals.h b/src/globals.h index c69306a6d6..45561dee3b 100644 --- a/src/globals.h +++ b/src/globals.h @@ -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); |