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.
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
}
- /* execute the function if no errors detected and executing */
- if (evaluate && error == ERROR_NONE)
+ /*
+ * Execute the function if executing and no errors were detected.
+ */
+ if (!evaluate)
+ {
+ // Not evaluating, which means the return value is unknown. This
+ // matters for giving error messages.
+ rettv->v_type = VAR_UNKNOWN;
+ }
+ else if (error == ERROR_NONE)
{
char_u *rfname = fname;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 19,
/**/
18,
/**/