0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.0.2091: Vim9: cannot convert list to string using +=

Problem:  Vim9: cannot convert list to string using +=
          (after 9.0.2072)
Solution: convert dict index to string later in compile_member()

fixes: #13485
closes: #13486

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan
2023-11-05 10:07:03 +01:00
committed by Christian Brabandt
parent 4f174f0de9
commit 6709816f78
4 changed files with 60 additions and 14 deletions

View File

@@ -2221,15 +2221,6 @@ compile_load_lhs(
return FAIL;
}
if (lhs->lhs_type->tt_type == VAR_DICT && var_start[varlen] == '[')
{
// If the lhs is a Dict variable and an item is accessed by "[",
// then need to convert the key into a string. The top item in the
// type stack is the Dict and the second last item is the key.
if (may_generate_2STRING(-2, FALSE, cctx) == FAIL)
return FAIL;
}
// Now we can properly check the type. The variable is indexed, thus
// we need the member type. For a class or object we don't know the
// type yet, it depends on what member is used.