You can use the return type "any".
I know in typescript it is possible to combine two types, e.g. you can
use "string | number". But not many other languages use this. I am not
convinced adding the combined type to Vim 9 script is a good choice.
For newly added builtin functions we will avoid mixing types, both for
the arguments and for the returned value. But several of the existing
functions do allow for different types, since they were designed for
runtime type checking.
--
hundred-and-one symptoms of being an internet addict:
28. You have comandeered your teenager's phone line for the net and even his
friends know not to call on his line anymore.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///