diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-05-22 18:31:35 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-05-22 18:31:35 +0200 |
commit | b4518563c73460150344a57879bf5b22cb8b1c77 (patch) | |
tree | bd32958994688a8d0116ce8961dee863c4d282c1 /src/testdir | |
parent | bdb657924d73c98b0ab28411749571e893b699a9 (diff) | |
download | vim-git-b4518563c73460150344a57879bf5b22cb8b1c77.tar.gz |
patch 8.1.0019: error when defining a Lambda with index of a function resultv8.1.0019
Problem: Error when defining a Lambda with index of a function result.
Solution: When not evaluating an expression and skipping a function call,
set the return value to VAR_UNKNOWN.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_lambda.vim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testdir/test_lambda.vim b/src/testdir/test_lambda.vim index 901d535e8..a95d591ce 100644 --- a/src/testdir/test_lambda.vim +++ b/src/testdir/test_lambda.vim @@ -284,3 +284,9 @@ func Test_named_function_closure() call test_garbagecollect_now() call assert_equal(14, s:Abar()) endfunc + +func Test_lambda_with_index() + let List = {x -> [x]} + let Extract = {-> function(List, ['foobar'])()[0]} + call assert_equal('foobar', Extract()) +endfunc |