patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Problem: Vim9: "echo Func()" does not give an error for a function without
a return value.
Solution: Give an error. Be more specific about why a value is invalid.
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 29cd5fc..ae4142b 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1578,7 +1578,8 @@
|| tv->v_type == VAR_JOB)
{
SOURCING_LNUM = iptr->isn_lnum;
- emsg(_(e_inval_string));
+ semsg(_(e_using_invalid_value_as_string_str),
+ vartype_name(tv->v_type));
break;
}
else