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.
diff --git a/src/evalbuffer.c b/src/evalbuffer.c
index d44fb10..de6af6a 100644
--- a/src/evalbuffer.c
+++ b/src/evalbuffer.c
@@ -752,6 +752,12 @@
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
*/