comparison src/vim9compile.c @ 24893:1d6242cf1163 v8.2.2984

patch 8.2.2984: Vim9: test fails because of missing return statement Commit: https://github.com/vim/vim/commit/e6174fd58d459722847c76f8c5aa1b08a49c3e0d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 12 18:30:56 2021 +0200 patch 8.2.2984: Vim9: test fails because of missing return statement Problem: Vim9: Test fails because of missing return statement. Solution: When type is unknown set type to void.
author Bram Moolenaar <Bram@vim.org>
date Sat, 12 Jun 2021 18:45:03 +0200
parents 0cba2be8cbd7
children e61a2085c89b
comparison
equal deleted inserted replaced
24892:e73a9667e471 24893:1d6242cf1163
9594 goto erret; 9594 goto erret;
9595 } 9595 }
9596 9596
9597 if (!cctx.ctx_had_return) 9597 if (!cctx.ctx_had_return)
9598 { 9598 {
9599 if (ufunc->uf_ret_type->tt_type != VAR_VOID) 9599 if (ufunc->uf_ret_type->tt_type == VAR_UNKNOWN)
9600 ufunc->uf_ret_type = &t_void;
9601 else if (ufunc->uf_ret_type->tt_type != VAR_VOID)
9600 { 9602 {
9601 emsg(_(e_missing_return_statement)); 9603 emsg(_(e_missing_return_statement));
9602 goto erret; 9604 goto erret;
9603 } 9605 }
9604 9606