comparison src/testdir/test_lambda.vim @ 14002:ade79e3e3b88 v8.1.0019

patch 8.1.0019: error when defining a Lambda with index of a function result commit https://github.com/vim/vim/commit/b4518563c73460150344a57879bf5b22cb8b1c77 Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 22 18:31:35 2018 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Tue, 22 May 2018 18:45:05 +0200
parents 8037eb704e93
children 63b02fcf1361
comparison
equal deleted inserted replaced
14001:4a78b9913023 14002:ade79e3e3b88
282 call Afoo() 282 call Afoo()
283 call assert_equal(14, s:Abar()) 283 call assert_equal(14, s:Abar())
284 call test_garbagecollect_now() 284 call test_garbagecollect_now()
285 call assert_equal(14, s:Abar()) 285 call assert_equal(14, s:Abar())
286 endfunc 286 endfunc
287
288 func Test_lambda_with_index()
289 let List = {x -> [x]}
290 let Extract = {-> function(List, ['foobar'])()[0]}
291 call assert_equal('foobar', Extract())
292 endfunc