mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.2527: Vim9: lambda return type is not determined at script level
Problem: Vim9: lambda return type is not determined at script level. Solution: Compile the lambda to get the return type. (closes #7843)
This commit is contained in:
10
src/eval.c
10
src/eval.c
@@ -3421,7 +3421,17 @@ eval7(
|
||||
*/
|
||||
case '(': ret = NOTDONE;
|
||||
if (in_vim9script())
|
||||
{
|
||||
ret = get_lambda_tv(arg, rettv, TRUE, evalarg);
|
||||
if (ret == OK && evaluate)
|
||||
{
|
||||
ufunc_T *ufunc = rettv->vval.v_partial->pt_func;
|
||||
|
||||
// compile it here to get the return type
|
||||
compile_def_function(ufunc,
|
||||
TRUE, PROFILING(ufunc), NULL);
|
||||
}
|
||||
}
|
||||
if (ret == NOTDONE)
|
||||
{
|
||||
*arg = skipwhite_and_linebreak(*arg + 1, evalarg);
|
||||
|
Reference in New Issue
Block a user