changeset 26735:44c7d42dff25 v8.2.3896

patch 8.2.3896: Vim9: no test for nested function not available later Commit: https://github.com/vim/vim/commit/db8e5c21b98c5998df4ab94e0b94bd9fdaf35c83 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 25 19:58:22 2021 +0000 patch 8.2.3896: Vim9: no test for nested function not available later Problem: Vim9: no test for nested function not available later. Solution: Add a test.
author Bram Moolenaar <Bram@vim.org>
date Sat, 25 Dec 2021 21:00:03 +0100
parents f5c8c084a576
children 94a38e7f8ba9
files src/testdir/test_vim9_func.vim src/version.c
diffstat 2 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -647,6 +647,21 @@ def Test_nested_function()
   END
   CheckDefFailure(lines, 'E1117:')
 
+  lines =<< trim END
+      vim9script
+      def Outer()
+        def Inner()
+          g:result = 'ok'
+        enddef
+        Inner()
+      enddef
+      Outer()
+      Inner()
+  END
+  CheckScriptFailure(lines, 'E117: Unknown function: Inner')
+  assert_equal('ok', g:result)
+  unlet g:result
+
   # nested function inside conditional
   lines =<< trim END
       vim9script
--- 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 */
 /**/
+    3896,
+/**/
     3895,
 /**/
     3894,