Problem: Vim9: crash when parsing function return type fails.
Solution: Bail out and set return type to "unknown". (closes #7685)
s:nothing->assert_equal(1)
enddef
+def Test_return_invalid()
+ var lines =<< trim END
+ vim9script
+ def Func(): invalid
+ return xxx
+ enddef
+ defcompile
+ END
+ CheckScriptFailure(lines, 'E1010:', 2)
+enddef
+
func Increment()
let g:counter += 1
endfunc
{
p = ret_type;
fp->uf_ret_type = parse_type(&p, &fp->uf_type_list, TRUE);
+ if (fp->uf_ret_type == NULL)
+ {
+ fp->uf_ret_type = &t_void;
+ SOURCING_LNUM = lnum_save;
+ goto erret;
+ }
}
SOURCING_LNUM = lnum_save;
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2357,
/**/
2356,
/**/