Mercurial > vim
comparison src/testdir/test_vim9_func.vim @ 25265:1d6ff96306fc v8.2.3169
patch 8.2.3169: Vim9: cannot handle nested inline function
Commit: https://github.com/vim/vim/commit/5245beb37cb52991a745644c20d7ca1b0138ef2c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 15 22:03:50 2021 +0200
patch 8.2.3169: Vim9: cannot handle nested inline function
Problem: Vim9: cannot handle nested inline function.
Solution: Check for nested inline function. (closes https://github.com/vim/vim/issues/8575)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 15 Jul 2021 22:15:03 +0200 |
parents | e5d85e83a887 |
children | d26dc79c533f |
comparison
equal
deleted
inserted
replaced
25264:19bc0f4c9379 | 25265:1d6ff96306fc |
---|---|
2253 }) | 2253 }) |
2254 enddef | 2254 enddef |
2255 assert_equal('--there', F('unused')('there')('--')) | 2255 assert_equal('--there', F('unused')('there')('--')) |
2256 END | 2256 END |
2257 CheckScriptSuccess(lines) | 2257 CheckScriptSuccess(lines) |
2258 | |
2259 lines =<< trim END | |
2260 vim9script | |
2261 echo range(4)->mapnew((_, v) => { | |
2262 return range(v) ->mapnew((_, s) => { | |
2263 return string(s) | |
2264 }) | |
2265 }) | |
2266 END | |
2267 CheckScriptSuccess(lines) | |
2258 enddef | 2268 enddef |
2259 | 2269 |
2260 def Shadowed(): list<number> | 2270 def Shadowed(): list<number> |
2261 var FuncList: list<func: number> = [() => 42] | 2271 var FuncList: list<func: number> = [() => 42] |
2262 return FuncList->mapnew((_, Shadowed) => Shadowed()) | 2272 return FuncList->mapnew((_, Shadowed) => Shadowed()) |