0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.1380: Vim9: return type of getreg() is always a string

Problem:    Vim9: return type of getreg() is always a string.
Solution:   Use list of strings when there are three arguments. (closes #6633)
This commit is contained in:
Bram Moolenaar
2020-08-06 21:26:59 +02:00
parent ae95a3946b
commit 3d945cc925
3 changed files with 18 additions and 1 deletions

View File

@@ -1202,6 +1202,12 @@ def Test_filter_return_type()
assert_equal(6, res)
enddef
def Test_getreg_return_type()
let s1: string = getreg('"')
let s2: string = getreg('"', 1)
let s3: list<string> = getreg('"', 1, 1)
enddef
def Wrong_dict_key_type(items: list<number>): list<number>
return filter(items, {_, val -> get({val: 1}, 'x')})
enddef