diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-01 14:04:46 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-01 14:04:46 +0100 |
commit | fbdd08ed9b1798885915c7f27c94786906d258e4 (patch) | |
tree | c228db6d29862aa4f3b7dbcdf19a009ceac12f4a /src/evalbuffer.c | |
parent | f4f190d8219fc93c6e58e54ce7c1ac15af07840f (diff) |
patch 8.2.0339: Vim9: function return type may depend on argumentsv8.2.0339
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.
Diffstat (limited to 'src/evalbuffer.c')
-rw-r--r-- | src/evalbuffer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/evalbuffer.c b/src/evalbuffer.c index d44fb10180..de6af6ad13 100644 --- a/src/evalbuffer.c +++ b/src/evalbuffer.c @@ -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 */ |