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

patch 9.0.2164: Vim9: can use type a func arg/return value

Problem:  Vim9: can use type a func arg/return value
Solution: Check if using type as function argument or return value

closes: #13675

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Ernie Rael
2023-12-14 20:11:44 +01:00
committed by Christian Brabandt
parent 9a775b4a2a
commit b077b58809
10 changed files with 271 additions and 10 deletions

View File

@@ -2661,6 +2661,8 @@ compile_return(char_u *arg, int check_return_type, int legacy, cctx_T *cctx)
// for an inline function without a specified return type. Set the
// return type here.
stack_type = get_type_on_stack(cctx, 0);
if (check_type_is_value(stack_type) == FAIL)
return NULL;
if ((check_return_type && (cctx->ctx_ufunc->uf_ret_type == NULL
|| cctx->ctx_ufunc->uf_ret_type == &t_unknown))
|| (!check_return_type