comparison src/testdir/test_vim9_script.vim @ 19467:f41e46f02c8c v8.2.0291

patch 8.2.0291: Vim9: assigning [] to list<string> doesn't work Commit: https://github.com/vim/vim/commit/436472f5e0328dc4a635b1c344c04a62d64132ea Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 20 22:54:43 2020 +0100 patch 8.2.0291: Vim9: assigning [] to list<string> doesn't work Problem: Vim9: assigning [] to list<string> doesn't work. Solution: Use void for empty list and dict. (Ken Takata, closes https://github.com/vim/vim/issues/5669)
author Bram Moolenaar <Bram@vim.org>
date Thu, 20 Feb 2020 23:00:05 +0100
parents 423b27246383
children 55656a51d2af
comparison
equal deleted inserted replaced
19466:f4820960d7e8 19467:f41e46f02c8c
38 assert_equal(v:false, bool2) 38 assert_equal(v:false, bool2)
39 39
40 let list1: list<string> = ['sdf', 'asdf'] 40 let list1: list<string> = ['sdf', 'asdf']
41 let list2: list<number> = [1, 2, 3] 41 let list2: list<number> = [1, 2, 3]
42 42
43 " TODO: does not work yet 43 let listS: list<string> = []
44 " let listS: list<string> = [] 44 let listN: list<number> = []
45 " let listN: list<number> = []
46 45
47 let dict1: dict<string> = #{key: 'value'} 46 let dict1: dict<string> = #{key: 'value'}
48 let dict2: dict<number> = #{one: 1, two: 2} 47 let dict2: dict<number> = #{one: 1, two: 2}
49 48
50 g:newvar = 'new' 49 g:newvar = 'new'