diff src/globals.h @ 26674:38a270fdd3f6 v8.2.3866

patch 8.2.3866: Vim9: type checking global variables is inconsistent Commit: https://github.com/vim/vim/commit/59618fed4ce118d12686c2e5c7c09601c8177817 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 21 12:32:17 2021 +0000 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.
author Bram Moolenaar <Bram@vim.org>
date Tue, 21 Dec 2021 13:45:03 +0100
parents bdf11d8e3df3
children 10d3105030ab
line wrap: on
line diff
--- a/src/globals.h
+++ b/src/globals.h
@@ -404,9 +404,16 @@ EXTERN int	garbage_collect_at_exit INIT(
 
 
 // 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);