patch 8.2.0973: Vim9: type is not checked when assigning to a script variable
Problem: Vim9: type is not checked when assigning to a script variable.
Solution: Check the type.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 9029a48..01af95e 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -139,7 +139,6 @@
static void delete_def_function_contents(dfunc_T *dfunc);
static void arg_type_mismatch(type_T *expected, type_T *actual, int argidx);
-static int check_type(type_T *expected, type_T *actual, int give_msg);
/*
* Lookup variable "name" in the local scope and return it.
@@ -461,7 +460,7 @@
/*
* Return the type_T for a typval. Only for primitive types.
*/
- static type_T *
+ type_T *
typval2type(typval_T *tv)
{
if (tv->v_type == VAR_NUMBER)
@@ -504,7 +503,7 @@
* Check if the expected and actual types match.
* Does not allow for assigning "any" to a specific type.
*/
- static int
+ int
check_type(type_T *expected, type_T *actual, int give_msg)
{
int ret = OK;