Mercurial > vim
comparison src/vim9compile.c @ 21411:e1aeb986712f v8.2.1256
patch 8.2.1256: Vim9: type wrong after getting dict item in lambda
Commit: https://github.com/vim/vim/commit/7892b953e0e496408008434ae3505293c0c93af1
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jul 20 22:09:34 2020 +0200
patch 8.2.1256: Vim9: type wrong after getting dict item in lambda
Problem: Vim9: type wrong after getting dict item in lambda.
Solution: Set the type to "any" after enforcing dict type. (closes https://github.com/vim/vim/issues/6491)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 20 Jul 2020 22:15:04 +0200 |
parents | 5cb6e676defd |
children | 0f0fee4122d3 |
comparison
equal
deleted
inserted
replaced
21410:4fde350c969a | 21411:e1aeb986712f |
---|---|
3795 } | 3795 } |
3796 if (vtype == VAR_DICT) | 3796 if (vtype == VAR_DICT) |
3797 { | 3797 { |
3798 if ((*typep)->tt_type == VAR_DICT) | 3798 if ((*typep)->tt_type == VAR_DICT) |
3799 *typep = (*typep)->tt_member; | 3799 *typep = (*typep)->tt_member; |
3800 else if (need_type(*typep, &t_dict_any, -2, cctx, FALSE) | 3800 else |
3801 == FAIL) | 3801 { |
3802 return FAIL; | 3802 if (need_type(*typep, &t_dict_any, -2, cctx, FALSE) == FAIL) |
3803 return FAIL; | |
3804 *typep = &t_any; | |
3805 } | |
3803 if (may_generate_2STRING(-1, cctx) == FAIL) | 3806 if (may_generate_2STRING(-1, cctx) == FAIL) |
3804 return FAIL; | 3807 return FAIL; |
3805 if (generate_instr_drop(cctx, ISN_MEMBER, 1) == FAIL) | 3808 if (generate_instr_drop(cctx, ISN_MEMBER, 1) == FAIL) |
3806 return FAIL; | 3809 return FAIL; |
3807 } | 3810 } |