mirror of
https://github.com/vim/vim.git
synced 2025-10-03 05:14:07 -04:00
patch 8.2.1201: Vim9: crash when passing number as dict key
Problem: Vim9: crash when passing number as dict key. Solution: Check key type to be string. (closes #6449)
This commit is contained in:
@@ -954,6 +954,14 @@ def Test_filter_return_type()
|
||||
assert_equal(6, res)
|
||||
enddef
|
||||
|
||||
def Wrong_dict_key_type(items: list<number>): list<number>
|
||||
return filter(items, {_, val -> get({val: 1}, 'x')})
|
||||
enddef
|
||||
|
||||
def Test_wrong_dict_key_type()
|
||||
assert_fails('Wrong_dict_key_type([1, 2, 3])', 'E1029:')
|
||||
enddef
|
||||
|
||||
def Line_continuation_in_def(dir: string = ''): string
|
||||
let path: string = empty(dir)
|
||||
\ ? 'empty'
|
||||
|
Reference in New Issue
Block a user