Problem: Vim9: crash when compiling lambda fails.
Solution: Bail out after compilation fails. (closes #7862)
ufunc_T *ufunc = rettv->vval.v_partial->pt_func;
// compile it here to get the return type
- compile_def_function(ufunc,
- TRUE, PROFILING(ufunc), NULL);
+ if (compile_def_function(ufunc,
+ TRUE, PROFILING(ufunc), NULL) == FAIL)
+ {
+ clear_tv(rettv);
+ ret = FAIL;
+ }
}
}
if (ret == NOTDONE)
Ref = (j) => !j
END
CheckDefAndScriptFailure(lines, 'E1012: Type mismatch; expected func(number) but got func(any): bool')
+
+ lines =<< trim END
+ echo filter([1, 2, 3], (_, v: string) => v + 1)
+ END
+ CheckDefAndScriptFailure(lines, 'E1051:')
enddef
def Test_heredoc()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2528,
/**/
2527,
/**/