patch 9.1.0314: Vim9: Can define a class in a function
Problem: Vim9: Can define a class in a function
(Doug Kearns)
Solution: Give an error for a class defined in a function,
slightly reword some public error messages
(Yegappan Lakshmanan)
fixes: #13184
fixes: #13326
closes: #14537
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9compile.c b/src/vim9compile.c
index c6b0247..7e1d911 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -4028,10 +4028,13 @@
line = (char_u *)"";
break;
+ case CMD_class:
+ emsg(_(e_class_can_only_be_used_in_script));
+ goto erret;
+
case CMD_type:
emsg(_(e_type_can_only_be_used_in_script));
goto erret;
- break;
case CMD_global:
if (check_global_and_subst(ea.cmd, p) == FAIL)