patch 8.2.2095: Vim9: crash when failed dict member is followed by concat
Problem: Vim9: crash when failed dict member is followed by concatenation.
Solution: Remove the dict from the stack. (closes #7416)
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 18aefe0..18864cf 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -1794,6 +1794,25 @@
enddef
sil! Func()
assert_equal('none', g:result)
+ unlet g:result
+ END
+ CheckScriptSuccess(lines)
+enddef
+
+def Test_dict_member_with_silent()
+ var lines =<< trim END
+ vim9script
+ g:result = 'none'
+ var d: dict<any>
+ def Func()
+ try
+ g:result = map([], {_, v -> {}[v]})->join() .. d['']
+ catch
+ endtry
+ enddef
+ silent! Func()
+ assert_equal('0', g:result)
+ unlet g:result
END
CheckScriptSuccess(lines)
enddef