1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar
2021-04-24 14:15:41 +02:00
parent 7ba1e4d363
commit 96cf4ba8fb
11 changed files with 64 additions and 28 deletions

View File

@@ -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)