patch 8.2.2635: Vim9: cannot define an inline function
Problem: Vim9: cannot define an inline function.
Solution: Make an inline function mostly work.
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index afe5f7d..6b9b54a 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1946,6 +1946,25 @@
CheckScriptSuccess(lines)
enddef
+def Test_expr7_lambda_block()
+ var lines =<< trim END
+ var Func = (s: string): string => {
+ return 'hello ' .. s
+ }
+ assert_equal('hello there', Func('there'))
+
+ var ll = range(3)
+ var dll = mapnew(ll, (k, v): string => {
+ if v % 2
+ return 'yes'
+ endif
+ return 'no'
+ })
+ assert_equal(['no', 'yes', 'no'], dll)
+ END
+ CheckDefAndScriptSuccess(lines)
+enddef
+
def NewLambdaWithComments(): func
return (x) =>
# some comment