patch 9.1.0349: Vim9: need static type for typealias
Problem: Vim9: need static type for typealias
Solution: Refactor the typval2type() function and add a static type for
typealias (Yegappan Lakshmanan)
closes: #14582
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/globals.h b/src/globals.h
index 29ad7ed..2c00e5f 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -540,7 +540,10 @@
#define t_class (static_types[84])
#define t_const_class (static_types[85])
-EXTERN type_T static_types[86]
+#define t_typealias (static_types[86])
+#define t_const_typealias (static_types[87])
+
+EXTERN type_T static_types[88]
#ifdef DO_INIT
= {
// 0: t_unknown
@@ -714,6 +717,10 @@
// 84: t_class
{VAR_CLASS, 0, 0, TTFLAG_STATIC, NULL, NULL, NULL},
{VAR_CLASS, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, NULL, NULL, NULL},
+
+ // 86: t_typealias
+ {VAR_TYPEALIAS, 0, 0, TTFLAG_STATIC, NULL, NULL, NULL},
+ {VAR_TYPEALIAS, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, NULL, NULL, NULL},
}
#endif
;