comparison 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
comparison
equal deleted inserted replaced
24060:1a3bde529268 24061:d6489b4eb14e
735 735
736 def Test_lambda_uses_assigned_var() 736 def Test_lambda_uses_assigned_var()
737 CheckDefSuccess([ 737 CheckDefSuccess([
738 'var x: any = "aaa"' 738 'var x: any = "aaa"'
739 'x = filter(["bbb"], (_, v) => v =~ x)']) 739 'x = filter(["bbb"], (_, v) => v =~ x)'])
740 enddef
741
742 def Test_pass_legacy_lambda_to_def_func()
743 var lines =<< trim END
744 vim9script
745 func Foo()
746 eval s:Bar({x -> 0})
747 endfunc
748 def Bar(y: any)
749 enddef
750 Foo()
751 END
752 CheckScriptSuccess(lines)
740 enddef 753 enddef
741 754
742 " Default arg and varargs 755 " Default arg and varargs
743 def MyDefVarargs(one: string, two = 'foo', ...rest: list<string>): string 756 def MyDefVarargs(one: string, two = 'foo', ...rest: list<string>): string
744 var res = one .. ',' .. two 757 var res = one .. ',' .. two