Mercurial > vim
comparison src/list.c @ 24438:5c6ccab68d1e v8.2.2759
patch 8.2.2759: Vim9: for loop infers type of loop variable
Commit: https://github.com/vim/vim/commit/f2253963c28e4791092620df6a6bb238c33168df
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Apr 13 20:53:13 2021 +0200
patch 8.2.2759: Vim9: for loop infers type of loop variable
Problem: Vim9: for loop infers type of loop variable.
Solution: Do not get the member type. (closes https://github.com/vim/vim/issues/8102)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 13 Apr 2021 21:00:05 +0200 |
parents | d406858354a6 |
children | 3d5a66e478f8 |
comparison
equal
deleted
inserted
replaced
24437:c63e5ce43b69 | 24438:5c6ccab68d1e |
---|---|
2057 copy_tv(&argvars[0], rettv); | 2057 copy_tv(&argvars[0], rettv); |
2058 if (filtermap == FILTERMAP_MAP && in_vim9script()) | 2058 if (filtermap == FILTERMAP_MAP && in_vim9script()) |
2059 { | 2059 { |
2060 // Check that map() does not change the type of the dict. | 2060 // Check that map() does not change the type of the dict. |
2061 ga_init2(&type_list, sizeof(type_T *), 10); | 2061 ga_init2(&type_list, sizeof(type_T *), 10); |
2062 type = typval2type(argvars, get_copyID(), &type_list); | 2062 type = typval2type(argvars, get_copyID(), &type_list, TRUE); |
2063 } | 2063 } |
2064 | 2064 |
2065 if (argvars[0].v_type == VAR_BLOB) | 2065 if (argvars[0].v_type == VAR_BLOB) |
2066 { | 2066 { |
2067 if (filtermap == FILTERMAP_MAPNEW) | 2067 if (filtermap == FILTERMAP_MAPNEW) |
2563 | 2563 |
2564 if (!is_new && in_vim9script()) | 2564 if (!is_new && in_vim9script()) |
2565 { | 2565 { |
2566 // Check that map() does not change the type of the dict. | 2566 // Check that map() does not change the type of the dict. |
2567 ga_init2(&type_list, sizeof(type_T *), 10); | 2567 ga_init2(&type_list, sizeof(type_T *), 10); |
2568 type = typval2type(argvars, get_copyID(), &type_list); | 2568 type = typval2type(argvars, get_copyID(), &type_list, TRUE); |
2569 } | 2569 } |
2570 | 2570 |
2571 if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_LIST) | 2571 if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_LIST) |
2572 { | 2572 { |
2573 list_T *l1, *l2; | 2573 list_T *l1, *l2; |