mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.2.1710: Vim9: list of list type can be wrong
Problem: Vim9: list of list type can be wrong. Solution: Use VAR_UNKNOWN for empty list. Recognize VAR_UNKNOWN when looking for a common type. (closes #6979)
This commit is contained in:
@@ -1513,6 +1513,10 @@ def Test_expr7_list()
|
||||
2] [3,
|
||||
4]
|
||||
|
||||
let llstring: list<list<string>> = [['text'], []]
|
||||
llstring = [[], ['text']]
|
||||
llstring = [[], []]
|
||||
|
||||
CheckDefFailure(["let x = 1234[3]"], 'E1107:', 1)
|
||||
CheckDefExecFailure(["let x = g:anint[3]"], 'E1062:', 1)
|
||||
|
||||
@@ -1718,6 +1722,14 @@ def Test_expr7_dict()
|
||||
mixed = #{a: 234}
|
||||
mixed = #{}
|
||||
|
||||
let dictlist: dict<list<string>> = #{absent: [], present: ['hi']}
|
||||
dictlist = #{absent: ['hi'], present: []}
|
||||
dictlist = #{absent: [], present: []}
|
||||
|
||||
let dictdict: dict<dict<string>> = #{one: #{a: 'text'}, two: #{}}
|
||||
dictdict = #{one: #{}, two: #{a: 'text'}}
|
||||
dictdict = #{one: #{}, two: #{}}
|
||||
|
||||
CheckDefFailure(["let x = #{a:8}"], 'E1069:', 1)
|
||||
CheckDefFailure(["let x = #{a : 8}"], 'E1068:', 1)
|
||||
CheckDefFailure(["let x = #{a :8}"], 'E1068:', 1)
|
||||
|
Reference in New Issue
Block a user