constdict->assert_equal({one: 1, two: {five: 55, six: 66}, three: 3})
END
v9.CheckDefAndScriptSuccess(lines)
+
+ # "any" type with const flag is recognized as "any"
+ lines =<< trim END
+ const dict: dict<any> = {foo: {bar: 42}}
+ const foo = dict.foo
+ assert_equal(v:t_number, type(foo.bar))
+ END
+ v9.CheckDefAndScriptSuccess(lines)
enddef
def Test_const_bang()
// check for dict type
type = get_type_on_stack(cctx, 0);
- if (type->tt_type != VAR_DICT && type != &t_any && type != &t_unknown)
+ if (type->tt_type != VAR_DICT
+ && type->tt_type != VAR_ANY && type->tt_type != VAR_UNKNOWN)
{
char *tofree;
// change dict type to dict member type
if (type->tt_type == VAR_DICT)
{
- type_T *ntype = type->tt_member == &t_unknown
+ type_T *ntype = type->tt_member->tt_type == VAR_UNKNOWN
? &t_any : type->tt_member;
set_type_on_stack(cctx, ntype, 0);
}