diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-15 22:03:50 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-15 22:03:50 +0200 |
commit | 5245beb37cb52991a745644c20d7ca1b0138ef2c (patch) | |
tree | 4156f638b3e12e39f87fc4c86f9df921212ba5e4 /src/testdir | |
parent | 378697ac58b8f9705286e36d1805a052e96fb86e (diff) |
patch 8.2.3169: Vim9: cannot handle nested inline functionv8.2.3169
Problem: Vim9: cannot handle nested inline function.
Solution: Check for nested inline function. (closes #8575)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_expr.vim | 3 | ||||
-rw-r--r-- | src/testdir/test_vim9_func.vim | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index ae48a89604..cd6ffa4463 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -2082,7 +2082,8 @@ def Test_expr7_lambda_block() var Func = (nr: number): int => { return nr END - CheckDefAndScriptFailure(lines, 'E1171', 1) # line nr is function start + CheckDefFailure(lines, 'E1171', 0) # line nr is function start + CheckScriptFailure(['vim9script'] + lines, 'E1171', 2) lines =<< trim END var Func = (nr: number): int => { diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 08e68d147c..c89c13e2dc 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -2255,6 +2255,16 @@ def Test_nested_inline_lambda() assert_equal('--there', F('unused')('there')('--')) END CheckScriptSuccess(lines) + + lines =<< trim END + vim9script + echo range(4)->mapnew((_, v) => { + return range(v) ->mapnew((_, s) => { + return string(s) + }) + }) + END + CheckScriptSuccess(lines) enddef def Shadowed(): list<number> |