diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2024-04-13 17:58:09 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-04-13 18:04:53 +0200 |
commit | c51578fed8f21cf3c1ff72bbb599dca2db02be84 (patch) | |
tree | 230f9c92871fb512962c94e779591281229656fc /src/vim9compile.c | |
parent | 122d068585686babd63f0b729759ec269171d464 (diff) |
patch 9.1.0314: Vim9: Can define a class in a functionv9.1.0314
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>
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r-- | src/vim9compile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c index c6b02478ce..7e1d911c1c 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -4028,10 +4028,13 @@ compile_def_function( 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) |