1
0
forked from aniani/vim

patch 8.2.0683: Vim9: parsing type does not always work

Problem:    Vim9: parsing type does not always work.
Solution:   Handle func type without return value.  Test more closures.
            Fix type check offset.  Fix garbage collection.
This commit is contained in:
Bram Moolenaar
2020-05-02 23:12:58 +02:00
parent 1c0d44f8ef
commit 5adc55cb74
6 changed files with 84 additions and 6 deletions

View File

@@ -4392,6 +4392,8 @@ set_ref_in_functions(int copyID)
fp = HI2UF(hi);
if (!func_name_refcount(fp->uf_name))
abort = abort || set_ref_in_func(NULL, fp, copyID);
else if (fp->uf_dfunc_idx >= 0)
abort = abort || set_ref_in_dfunc(fp, copyID);
}
}
return abort;
@@ -4439,7 +4441,10 @@ set_ref_in_func(char_u *name, ufunc_T *fp_in, int copyID)
{
for (fc = fp->uf_scoped; fc != NULL; fc = fc->func->uf_scoped)
abort = abort || set_ref_in_funccal(fc, copyID);
if (fp->uf_dfunc_idx >= 0)
abort = abort || set_ref_in_dfunc(fp, copyID);
}
vim_free(tofree);
return abort;
}