Mercurial > vim
diff src/testdir/test_vim9_func.vim @ 24531:3bfec39ce31c v8.2.2805
patch 8.2.2805: Vim9: cannot use legacy syntax in Vim9 script
Commit: https://github.com/vim/vim/commit/96cf4ba8fb96e5778192d2dab7458b9a7da0a49d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 24 14:15:41 2021 +0200
patch 8.2.2805: Vim9: cannot use legacy syntax in Vim9 script
Problem: Vim9: cannot use legacy syntax in Vim9 script.
Solution: Add the :legacy command.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 24 Apr 2021 14:30:04 +0200 |
parents | 887121a6d7cf |
children | 3a290891a015 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -2165,6 +2165,14 @@ def Test_list_lambda() assert_match('def <lambda>\d\+(_: any): number\n1 return 0\n enddef', body) enddef +def Test_legacy_lambda() + legacy echo {x -> 'hello ' .. x}('foo') + var lines =<< trim END + echo {x -> 'hello ' .. x}('foo') + END + CheckDefAndScriptFailure(lines, 'E720:') +enddef + def DoFilterThis(a: string): list<string> # closure nested inside another closure using argument var Filter = (l) => filter(l, (_, v) => stridx(v, a) == 0)