summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/testdir/test_vim9_func.vim4
-rw-r--r--src/version.c2
-rw-r--r--src/vim9compile.c4
3 files changed, 9 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 2714fa1cc..d67dd55b6 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -74,6 +74,10 @@ def TestCompilingErrorInTry()
delete('Xdir', 'rf')
enddef
+def Test_comment_error()
+ v9.CheckDefFailure(['#{ comment'], 'E1170:')
+enddef
+
def Test_compile_error_in_called_function()
var lines =<< trim END
vim9script
diff --git a/src/version.c b/src/version.c
index 507feaa49..840a1eb67 100644
--- a/src/version.c
+++ b/src/version.c
@@ -736,6 +736,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 174,
+/**/
173,
/**/
172,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index c6316367e..98fc84c58 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2899,7 +2899,9 @@ compile_def_function(
if (*ea.cmd == '#')
{
- // "#" starts a comment
+ // "#" starts a comment, but "#{" is an error
+ if (vim9_bad_comment(ea.cmd))
+ goto erret;
line = (char_u *)"";
continue;
}