0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.0992: Vim9 script: get E1096 when comment follows return

Problem:    Vim9 script: get E1096 when comment follows return.
Solution:   Adjust condition for return without expression. (closes #11654)
This commit is contained in:
mityu
2022-12-02 18:12:05 +00:00
committed by Bram Moolenaar
parent c67c89c758
commit 500c444283
3 changed files with 15 additions and 1 deletions

View File

@@ -2531,7 +2531,8 @@ compile_return(char_u *arg, int check_return_type, int legacy, cctx_T *cctx)
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.