diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index c400e82ac..2f1e708f2 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1169,6 +1169,26 @@ def Test_try_catch_nested() assert_equal('finally', g:in_finally) enddef +def TryOne(): number + try + return 0 + catch + endtry + return 0 +enddef + +def TryTwo(n: number): string + try + let x = {} + catch + endtry + return 'text' +enddef + +def Test_try_catch_twice() + assert_equal('text', TryOne()->TryTwo()) +enddef + def Test_try_catch_match() let seq = 'a' try diff --git a/src/version.c b/src/version.c index e77c7957e..ff5534ff6 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1700, /**/ 1699, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index 7c8f77977..40d6193ca 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -1922,6 +1922,7 @@ call_def_function( trycmd->tcd_catch_idx = iptr->isn_arg.try.try_catch; trycmd->tcd_finally_idx = iptr->isn_arg.try.try_finally; trycmd->tcd_caught = FALSE; + trycmd->tcd_return = FALSE; } break;