Mercurial > vim
diff src/testdir/test_vim9_func.vim @ 24061:d6489b4eb14e v8.2.2572
patch 8.2.2572: Vim9: crash when getting the types for a legacy function
Commit: https://github.com/vim/vim/commit/18062fcad648540369db5989aac297431119e037
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Mar 5 21:35:47 2021 +0100
patch 8.2.2572: Vim9: crash when getting the types for a legacy function
Problem: Vim9: crash when getting the types for a legacy function.
Solution: Initialize the type list growarray. (closes https://github.com/vim/vim/issues/7929)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 05 Mar 2021 21:45:02 +0100 |
parents | 308d29307910 |
children | a6aec9a89184 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -739,6 +739,19 @@ def Test_lambda_uses_assigned_var() 'x = filter(["bbb"], (_, v) => v =~ x)']) enddef +def Test_pass_legacy_lambda_to_def_func() + var lines =<< trim END + vim9script + func Foo() + eval s:Bar({x -> 0}) + endfunc + def Bar(y: any) + enddef + Foo() + END + CheckScriptSuccess(lines) +enddef + " Default arg and varargs def MyDefVarargs(one: string, two = 'foo', ...rest: list<string>): string var res = one .. ',' .. two