0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2983: Vim9: an inline function requires specifying the return type

Problem:    Vim9: an inline function requires specifying the return type.
Solution:   Make the return type optional.
This commit is contained in:
Bram Moolenaar
2021-06-12 15:58:16 +02:00
parent 7423577180
commit a993153538
5 changed files with 41 additions and 6 deletions

View File

@@ -3530,9 +3530,13 @@ eval7(
{
ufunc_T *ufunc = rettv->vval.v_partial->pt_func;
// compile it here to get the return type
// Compile it here to get the return type. The return
// type is optional, when it's missing use t_unknown.
// This is recognized in compile_return().
if (ufunc->uf_ret_type->tt_type == VAR_VOID)
ufunc->uf_ret_type = &t_unknown;
if (compile_def_function(ufunc,
TRUE, PROFILING(ufunc), NULL) == FAIL)
FALSE, PROFILING(ufunc), NULL) == FAIL)
{
clear_tv(rettv);
ret = FAIL;