patch 8.2.4526: Vim9: cannot set variables to a null value
Problem: Vim9: cannot set variables to a null value.
Solution: Add null_list, null_job, etc.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 634f24e..6a3c32a 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -403,8 +403,12 @@
if (ret == OK)
return OK;
+ // If actual a constant a runtime check makes no sense. If it's
+ // null_function it is OK.
+ if (actual_is_const && ret == MAYBE && actual == &t_func_unknown)
+ return OK;
+
// If the actual type can be the expected type add a runtime check.
- // If it's a constant a runtime check makes no sense.
if (!actual_is_const && ret == MAYBE && use_typecheck(actual, expected))
{
generate_TYPECHECK(cctx, expected, offset, where.wt_index);