mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.1459: Vim9: declaring script var in script does not infer the type
Problem: Vim9: declaring ascript variable at the script level does not infer the type. Solution: Get the type from the value. (closes #6716)
This commit is contained in:
@@ -3049,7 +3049,10 @@ set_var_const(
|
||||
+ si->sn_var_vals.ga_len;
|
||||
sv->sv_name = di->di_key;
|
||||
sv->sv_tv = &di->di_tv;
|
||||
sv->sv_type = type == NULL ? &t_any : type;
|
||||
if (type == NULL)
|
||||
sv->sv_type = typval2type(tv, &si->sn_type_list);
|
||||
else
|
||||
sv->sv_type = type;
|
||||
sv->sv_const = (flags & LET_IS_CONST);
|
||||
sv->sv_export = is_export;
|
||||
++si->sn_var_vals.ga_len;
|
||||
|
Reference in New Issue
Block a user