]> granicus.if.org Git - vim/commitdiff
patch 8.2.2984: Vim9: test fails because of missing return statement v8.2.2984
authorBram Moolenaar <Bram@vim.org>
Sat, 12 Jun 2021 16:30:56 +0000 (18:30 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 12 Jun 2021 16:30:56 +0000 (18:30 +0200)
Problem:    Vim9: Test fails because of missing return statement.
Solution:   When type is unknown set type to void.

src/version.c
src/vim9compile.c

index fcb0d927a1f2f8591ec805136d2c6ce59ae17e46..7f459c27af0b2ea868228d27af19dca8d7ef46ff 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2984,
 /**/
     2983,
 /**/
index dfd5aaa3cbdde145b617395a9b93a52a8d49573d..47847af3aaa1553cab77cd608117edc6e3c37cb7 100644 (file)
@@ -9596,7 +9596,9 @@ nextline:
 
     if (!cctx.ctx_had_return)
     {
-       if (ufunc->uf_ret_type->tt_type != VAR_VOID)
+       if (ufunc->uf_ret_type->tt_type == VAR_UNKNOWN)
+           ufunc->uf_ret_type = &t_void;
+       else if (ufunc->uf_ret_type->tt_type != VAR_VOID)
        {
            emsg(_(e_missing_return_statement));
            goto erret;