mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 9.1.1040: Vim9: imported type cannot be used as func return type
Problem: Vim9: imported type cannot be used as func return type (Dayvid Albuquerque) Solution: temporarily reset the is_export flag (Yegappan Lakshmanan) fixes: #16489 closes: #16492 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
4335fcfed1
commit
d79ea47079
@@ -5472,11 +5472,19 @@ define_function(
|
||||
// The function may use script variables from the context.
|
||||
function_using_block_scopes(fp, cstack);
|
||||
|
||||
// The argument types and the return type may use an imported type.
|
||||
// In that case, the imported file will be sourced. To avoid treating
|
||||
// everything in the imported file as exported, temporarily reset
|
||||
// is_export.
|
||||
int save_is_export = is_export;
|
||||
is_export = FALSE;
|
||||
|
||||
if (parse_argument_types(fp, &argtypes, varargs, &arg_objm,
|
||||
obj_members, obj_member_count) == FAIL)
|
||||
{
|
||||
SOURCING_LNUM = lnum_save;
|
||||
free_fp = fp_allocated;
|
||||
is_export = save_is_export;
|
||||
goto erret;
|
||||
}
|
||||
varargs = FALSE;
|
||||
@@ -5486,8 +5494,10 @@ define_function(
|
||||
{
|
||||
SOURCING_LNUM = lnum_save;
|
||||
free_fp = fp_allocated;
|
||||
is_export = save_is_export;
|
||||
goto erret;
|
||||
}
|
||||
is_export = save_is_export;
|
||||
SOURCING_LNUM = lnum_save;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user