Problem: Vim9 script: get E1096 when comment follows return.
Solution: Adjust condition for return without expression. (closes #11654)
v9.CheckScriptSuccess(lines)
enddef
+def Test_return_void_comment_follows()
+ var lines =<< trim END
+ vim9script
+ def ReturnCommentFollows(): void
+ return # Some comment
+ enddef
+ defcompile
+ END
+ v9.CheckScriptSuccess(lines)
+enddef
+
let s:nothing = 0
def ReturnNothing()
s:nothing = 1
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 992,
/**/
991,
/**/
char_u *p = arg;
type_T *stack_type;
- if (*p != NUL && *p != '|' && *p != '\n')
+ if (*p != NUL && *p != '|' && *p != '\n'
+ && (legacy || !vim9_comment_start(p)))
{
// For a lambda, "return expr" is always used, also when "expr" results
// in a void.