0
0
mirror of https://github.com/vim/vim.git synced 2025-10-18 07:54:29 -04:00

patch 8.2.1096: Vim9: return type of getqflist() is wrong

Problem:    Vim9: return type of getqflist() is wrong.
Solution:   Let the return type depend on the arguments.  Also for
            getloclist(). (closes #6367)
This commit is contained in:
Bram Moolenaar
2020-06-30 13:38:01 +02:00
parent 6b949615ed
commit f151ad1c70
3 changed files with 44 additions and 2 deletions

View File

@@ -837,6 +837,22 @@ def Test_sort_return_type()
res = [1, 2, 3]->sort()
enddef
def Test_getqflist_return_type()
let l = getqflist()
assert_equal([], l)
let d = getqflist(#{items: 0})
assert_equal(#{items: []}, d)
enddef
def Test_getloclist_return_type()
let l = getloclist(1)
assert_equal([], l)
let d = getloclist(1, #{items: 0})
assert_equal(#{items: []}, d)
enddef
def Line_continuation_in_def(dir: string = ''): string
let path: string = empty(dir)
\ ? 'empty'