Mercurial > vim
changeset 25386:9c749ad22565 v8.2.3230
patch 8.2.3230: Vim9: type error when function return type is not known yet
Commit: https://github.com/vim/vim/commit/f723701de0636ad8b4aad6179b322f72b04354b9
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 27 22:21:44 2021 +0200
patch 8.2.3230: Vim9: type error when function return type is not known yet
Problem: Vim9: type error when function return type is not known yet.
Solution: When return type is unknown, use "any". (closes https://github.com/vim/vim/issues/8644)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 27 Jul 2021 22:30:03 +0200 |
parents | c785de20eb86 |
children | beb96a39cfac |
files | src/testdir/test_vim9_builtin.vim src/version.c src/vim9compile.c |
diffstat | 3 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -1172,6 +1172,16 @@ def Test_get() var F: func = function('min', [[5, 8, 6]]) F->get('name')->assert_equal('min') F->get('args')->assert_equal([[5, 8, 6]]) + + var lines =<< trim END + vim9script + def DoThat(): number + var Getqflist: func = function('getqflist', [{id: 42}]) + return Getqflist()->get('id', 77) + enddef + assert_equal(0, DoThat()) + END + CheckScriptSuccess(lines) enddef def Test_getbufinfo()