diff src/userfunc.c @ 20255:aac52c32a91f v8.2.0683

patch 8.2.0683: Vim9: parsing type does not always work Commit: https://github.com/vim/vim/commit/5adc55cb746893c6ddf7865ff654582902dee2e3 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 2 23:12:58 2020 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Sat, 02 May 2020 23:15:03 +0200
parents 23d75968ca5e
children 683c2da4982b
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -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 *f
     {
 	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;
 }