diff src/testdir/test_vim9_func.vim @ 25030:214fddf4c765 v8.2.3052

patch 8.2.3052: Vim9: "legacy call" does not work Commit: https://github.com/vim/vim/commit/ce024c3e20839465dc8c8f79dcccc5414dd8c506 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 26 13:00:49 2021 +0200 patch 8.2.3052: Vim9: "legacy call" does not work Problem: Vim9: "legacy call" does not work. Solution: Do not skip "call" after "legacy". (closes https://github.com/vim/vim/issues/8454)
author Bram Moolenaar <Bram@vim.org>
date Sat, 26 Jun 2021 13:15:03 +0200
parents 0136c6ee1961
children efdb9608cc11
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -2316,6 +2316,23 @@ def Test_legacy_lambda()
   CheckScriptSuccess(lines)
 enddef
 
+def Test_legacy()
+  var lines =<< trim END
+      vim9script
+      func g:LegacyFunction()
+        let g:legacyvar = 1
+      endfunc
+      def Testit()
+        legacy call g:LegacyFunction()
+      enddef
+      Testit()
+      assert_equal(1, g:legacyvar)
+      unlet g:legacyvar
+      delfunc g:LegacyFunction
+  END
+  CheckScriptSuccess(lines)
+enddef
+
 def Test_legacy_errors()
   for cmd in ['if', 'elseif', 'else', 'endif',
               'for', 'endfor', 'continue', 'break',