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)
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)
return;
}
+ // If either is VAR_UNKNOWN use the other type. An empty list/dict has no
+ // specific type.
+ if (type1->tt_type == VAR_UNKNOWN)
+ {
+ *dest = type2;
+ return;
+ }
+ if (type2->tt_type == VAR_UNKNOWN)
+ {
+ *dest = type1;
+ return;
+ }
+
if (type1->tt_type == type2->tt_type)
{
if (type1->tt_type == VAR_LIST || type2->tt_type == VAR_DICT)
// Use "any" for an empty list or dict.
if (count == 0)
- return &t_void;
+ return &t_unknown;
// Use the first value type for the list member type, then find the common
// type from following items.