mirror of
https://github.com/vim/vim.git
synced 2025-10-03 05:14:07 -04:00
patch 8.2.1138: Vim9: return type of copy() and deepcopy() is any
Problem: Vim9: return type of copy() and deepcopy() is any. Solution: Use type of the argument.
This commit is contained in:
@@ -893,6 +893,22 @@ def Test_getloclist_return_type()
|
||||
assert_equal(#{items: []}, d)
|
||||
enddef
|
||||
|
||||
def Test_copy_return_type()
|
||||
let l = copy([1, 2, 3])
|
||||
let res = 0
|
||||
for n in l
|
||||
res += n
|
||||
endfor
|
||||
assert_equal(6, res)
|
||||
|
||||
let dl = deepcopy([1, 2, 3])
|
||||
res = 0
|
||||
for n in dl
|
||||
res += n
|
||||
endfor
|
||||
assert_equal(6, res)
|
||||
enddef
|
||||
|
||||
def Line_continuation_in_def(dir: string = ''): string
|
||||
let path: string = empty(dir)
|
||||
\ ? 'empty'
|
||||
|
Reference in New Issue
Block a user