Mercurial > vim
comparison src/vim9compile.c @ 22363:6c3d15011081 v8.2.1730
patch 8.2.1730: Vim9: cannot use member of unknown type
Commit: https://github.com/vim/vim/commit/04bdd573d0a48e789eb92ed2a81e0dd732761391
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 23 13:25:32 2020 +0200
patch 8.2.1730: Vim9: cannot use member of unknown type
Problem: Vim9: cannot use member of unknown type.
Solution: When type is unknown us "any". (closes https://github.com/vim/vim/issues/6997)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 23 Sep 2020 13:30:03 +0200 |
parents | 9f5a84baa464 |
children | 62192fd08e0e |
comparison
equal
deleted
inserted
replaced
22362:90bc9923a1df | 22363:6c3d15011081 |
---|---|
5078 emsg(_(e_cannot_use_void_value)); | 5078 emsg(_(e_cannot_use_void_value)); |
5079 goto theend; | 5079 goto theend; |
5080 } | 5080 } |
5081 else | 5081 else |
5082 { | 5082 { |
5083 // An empty list or dict has a &t_void member, | 5083 // An empty list or dict has a &t_unknown member, |
5084 // for a variable that implies &t_any. | 5084 // for a variable that implies &t_any. |
5085 if (stacktype == &t_list_empty) | 5085 if (stacktype == &t_list_empty) |
5086 lvar->lv_type = &t_list_any; | 5086 lvar->lv_type = &t_list_any; |
5087 else if (stacktype == &t_dict_empty) | 5087 else if (stacktype == &t_dict_empty) |
5088 lvar->lv_type = &t_dict_any; | 5088 lvar->lv_type = &t_dict_any; |
5089 else if (stacktype == &t_unknown) | |
5090 lvar->lv_type = &t_any; | |
5089 else | 5091 else |
5090 lvar->lv_type = stacktype; | 5092 lvar->lv_type = stacktype; |
5091 } | 5093 } |
5092 } | 5094 } |
5093 else if (*op == '=') | 5095 else if (*op == '=') |