1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar
2022-03-08 13:18:55 +00:00
parent 08238045e7
commit 8acb9cc620
16 changed files with 346 additions and 51 deletions

View File

@@ -403,8 +403,12 @@ need_type_where(
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);