Problem: Vim9: cannot change type of list after making a slice.
Solution: Adjust the declared member type. (closes #9696)
var lds: list<dict<string>> = [{key: 'value'}]
assert_equal(['val'], lds->slice(0, 1)->map((_, v) => 'val'))
+ assert_equal(['val'], lds[ : ]->map((_, v) => 'val'))
assert_equal(0z1122334455, slice(0z001122334455, 1))
assert_equal(0z112233, slice(0z001122334455, 1, 4))
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4313,
/**/
4312,
/**/
vartype == VAR_LIST ? ISN_LISTSLICE : ISN_ANYSLICE,
2) == FAIL)
return FAIL;
+ // a copy is made so the member type is no longer declared
+ if (typep->type_decl->tt_type == VAR_LIST)
+ typep->type_decl = &t_list_any;
}
else
{