Mercurial > vim
comparison src/vim9compile.c @ 25164:0e08e34fa0b8 v8.2.3118
patch 8.2.3118: Vim9: "any" type not handled correctly in for loop
Commit: https://github.com/vim/vim/commit/5ede5b231eb2269b0ef335f3cd24e4c4b1d4395b
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 7 21:55:25 2021 +0200
patch 8.2.3118: Vim9: "any" type not handled correctly in for loop
Problem: Vim9: "any" type not handled correctly in for loop.
Solution: Change compile time check into runtime check. (closes https://github.com/vim/vim/issues/8516)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 07 Jul 2021 22:00:04 +0200 |
parents | c44d6ac81c42 |
children | e5d85e83a887 |
comparison
equal
deleted
inserted
replaced
25163:0fc3365fc931 | 25164:0e08e34fa0b8 |
---|---|
7930 where.wt_index = var_list ? idx + 1 : 0; | 7930 where.wt_index = var_list ? idx + 1 : 0; |
7931 where.wt_variable = TRUE; | 7931 where.wt_variable = TRUE; |
7932 if (lhs_type == &t_any) | 7932 if (lhs_type == &t_any) |
7933 lhs_type = item_type; | 7933 lhs_type = item_type; |
7934 else if (item_type != &t_unknown | 7934 else if (item_type != &t_unknown |
7935 && ((var_list && item_type == &t_any) | 7935 && (item_type == &t_any |
7936 ? need_type(item_type, lhs_type, | 7936 ? need_type(item_type, lhs_type, |
7937 -1, 0, cctx, FALSE, FALSE) | 7937 -1, 0, cctx, FALSE, FALSE) |
7938 : check_type(lhs_type, item_type, TRUE, where)) | 7938 : check_type(lhs_type, item_type, TRUE, where)) |
7939 == FAIL) | 7939 == FAIL) |
7940 goto failed; | 7940 goto failed; |