patch 8.2.3005: Vim9: using a void value does not give a proper error message
Problem: Vim9: using a void value does not give a proper error message.
Solution: Give a clear error message. (clodes #8387)
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 8389399..663a52d 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -9679,8 +9679,8 @@
goto erret;
}
- // Return zero if there is no return at the end.
- generate_instr(&cctx, ISN_RETURN_ZERO);
+ // Return void if there is no return at the end.
+ generate_instr(&cctx, ISN_RETURN_VOID);
}
// When compiled with ":silent!" and there was an error don't consider the
@@ -10047,7 +10047,7 @@
case ISN_REDIREND:
case ISN_REDIRSTART:
case ISN_RETURN:
- case ISN_RETURN_ZERO:
+ case ISN_RETURN_VOID:
case ISN_SHUFFLE:
case ISN_SLICE:
case ISN_STORE: