diff 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
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -5080,12 +5080,14 @@ compile_assignment(char_u *arg, exarg_T 
 			}
 			else
 			{
-			    // An empty list or dict has a &t_void member,
+			    // An empty list or dict has a &t_unknown member,
 			    // for a variable that implies &t_any.
 			    if (stacktype == &t_list_empty)
 				lvar->lv_type = &t_list_any;
 			    else if (stacktype == &t_dict_empty)
 				lvar->lv_type = &t_dict_any;
+			    else if (stacktype == &t_unknown)
+				lvar->lv_type = &t_any;
 			    else
 				lvar->lv_type = stacktype;
 			}