0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.0339: Vim9: function return type may depend on arguments

Problem:    Vim9: function return type may depend on arguments.
Solution:   Instead of a fixed return type use a function to figure out the
            return type.
This commit is contained in:
Bram Moolenaar
2020-03-01 14:04:46 +01:00
parent f4f190d821
commit fbdd08ed9b
7 changed files with 609 additions and 500 deletions

View File

@@ -752,6 +752,12 @@ f_getbufline(typval_T *argvars, typval_T *rettv)
get_buffer_lines(buf, lnum, end, TRUE, rettv);
}
type_T *
ret_f_getline(int argcount, type_T **argtypes UNUSED)
{
return argcount == 1 ? &t_string : &t_list_string;
}
/*
* "getline(lnum, [end])" function
*/