From 2ea6d3ab974aad74cdcbe12a15a7a65956cc6e33 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 14 Mar 2019 23:52:17 -0400 Subject: vim-patch:8.1.0019: error when defining a Lambda with index of a function result 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. https://github.com/vim/vim/commit/b4518563c73460150344a57879bf5b22cb8b1c77 --- src/nvim/testdir/test_lambda.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/testdir/test_lambda.vim') diff --git a/src/nvim/testdir/test_lambda.vim b/src/nvim/testdir/test_lambda.vim index ada25da4a8..bc7817cef8 100644 --- a/src/nvim/testdir/test_lambda.vim +++ b/src/nvim/testdir/test_lambda.vim @@ -291,3 +291,9 @@ func Test_named_function_closure() call garbagecollect() 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 -- cgit