1
0
forked from aniani/vim

patch 8.2.4295: Vim9: concatenating two lists may result in wrong type

Problem:    Vim9: concatenating two lists may result in wrong type.
Solution:   Remove the type instead of using list<any>. (closes #9692)
This commit is contained in:
Bram Moolenaar
2022-02-04 11:36:51 +00:00
parent 972db23279
commit 46950b225f
3 changed files with 10 additions and 3 deletions

View File

@@ -1216,11 +1216,10 @@ list_copy(list_T *orig, int deep, int top, int copyID)
copy = list_alloc();
if (copy != NULL)
{
if (orig->lv_type == NULL)
if (orig->lv_type == NULL || top || deep)
copy->lv_type = NULL;
else
copy->lv_type = alloc_type(top || deep
? &t_list_any: orig->lv_type);
copy->lv_type = alloc_type(orig->lv_type);
if (copyID != 0)
{
// Do this before adding the items, because one of the items may