Mercurial > vim
diff src/testdir/test_vim9_func.vim @ 24996:0136c6ee1961 v8.2.3035
patch 8.2.3035: Vim9: crash when calling :def function with partial
Commit: https://github.com/vim/vim/commit/831bdf8622fdfce7f02d48f847005e3909a055a8
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 22 19:32:17 2021 +0200
patch 8.2.3035: Vim9: crash when calling :def function with partial
Problem: Vim9: crash when calling :def function with partial and return
type is not set.
Solution: When the return type is not set handle like the return type is
unknown. (closes #8422)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 22 Jun 2021 19:45:03 +0200 |
parents | 494112d2aa93 |
children | 214fddf4c765 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1005,6 +1005,20 @@ def Test_pass_legacy_lambda_to_def_func( Foo() END CheckScriptSuccess(lines) + + lines =<< trim END + vim9script + def g:TestFunc(f: func()) + enddef + legacy call g:TestFunc({-> 0}) + delfunc g:TestFunc + + def g:TestFunc(f: func(number)) + enddef + legacy call g:TestFunc({nr -> 0}) + delfunc g:TestFunc + END + CheckScriptSuccess(lines) enddef " Default arg and varargs