0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.4572: Vim9: return type "any" is changed to first returned type

Problem:    Vim9: return type "any" is sometimes changed to first returned
            type.  (Virginia Senioria)
Solution:   Do not change the return type if declared as "any". (closes #9949)
This commit is contained in:
Bram Moolenaar
2022-03-15 12:28:10 +00:00
parent 8d5e514d77
commit 1a572e9b3b
3 changed files with 27 additions and 2 deletions

View File

@@ -2258,8 +2258,7 @@ compile_return(char_u *arg, int check_return_type, int legacy, cctx_T *cctx)
// return type here.
stack_type = get_type_on_stack(cctx, 0);
if ((check_return_type && (cctx->ctx_ufunc->uf_ret_type == NULL
|| cctx->ctx_ufunc->uf_ret_type == &t_unknown
|| cctx->ctx_ufunc->uf_ret_type == &t_any))
|| cctx->ctx_ufunc->uf_ret_type == &t_unknown))
|| (!check_return_type
&& cctx->ctx_ufunc->uf_ret_type == &t_unknown))
{