diff src/testdir/test_vim9_func.vim @ 24854:c9ccb1976049 v8.2.2965

patch 8.2.2965: Vim9: crash when calling function that failed to compile Commit: https://github.com/vim/vim/commit/b55d618f193d9f413612d8d4e62758056e842e46 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 8 22:01:53 2021 +0200 patch 8.2.2965: Vim9: crash when calling function that failed to compile Problem: Vim9: crash when calling function that failed to compile. Solution: Fail when trying to call the function. (closes https://github.com/vim/vim/issues/8344)
author Bram Moolenaar <Bram@vim.org>
date Tue, 08 Jun 2021 22:15:02 +0200
parents a8d64f1a223b
children 193cc8bd8a2f
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -74,6 +74,22 @@ def TestCompilingErrorInTry()
   delete('Xdir', 'rf')
 enddef
 
+def Test_compile_error_in_called_function()
+  var lines =<< trim END
+      vim9script
+      var n: number
+      def Foo()
+        &hls = n
+      enddef
+      def Bar()
+        Foo()
+      enddef
+      silent! Foo()
+      Bar()
+  END
+  CheckScriptFailureList(lines, ['E1012:', 'E1191:'])
+enddef
+
 def Test_autoload_name_mismatch()
   var dir = 'Xdir/autoload'
   mkdir(dir, 'p')