patch 8.2.1272: Vim9: type not checked if declaration also assigns value
Problem: Vim9: type not checked if declaration also assigns value.
Solution: Check the type. (issue #6507)
diff --git a/src/vim9script.c b/src/vim9script.c
index 3c57d34..24953cd 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -557,7 +557,7 @@
semsg(_(e_readonlyvar), name);
return FAIL;
}
- return check_type(sv->sv_type, typval2type(value), TRUE);
+ return check_typval_type(sv->sv_type, value);
}
}
iemsg("check_script_var_type(): not found");