0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1503: Vim9: error for autocmd defined in :def in legacy script

Problem:    Vim9: error for an autocmd defined in a :def function in legacy
            Vim script.
Solution:   Don't check the variable type. (closes #6758)
This commit is contained in:
Bram Moolenaar
2020-08-21 21:55:43 +02:00
parent 122616d9c1
commit 81e17fbe00
3 changed files with 23 additions and 0 deletions

View File

@@ -564,6 +564,10 @@ check_script_var_type(typval_T *dest, typval_T *value, char_u *name)
scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
int idx;
if (si->sn_version != SCRIPT_VERSION_VIM9)
// legacy script doesn't store variable types
return OK;
// Find the svar_T in sn_var_vals.
for (idx = 0; idx < si->sn_var_vals.ga_len; ++idx)
{