Mercurial > vim
comparison src/vim9script.c @ 21907:f4e21796f47d v8.2.1503
patch 8.2.1503: Vim9: error for autocmd defined in :def in legacy script
Commit: https://github.com/vim/vim/commit/81e17fbe00fd2ed93b262adc3ba41c86b02e7f46
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 21 21:55:43 2020 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 21 Aug 2020 22:00:04 +0200 |
parents | 0deb6f96a5a3 |
children | a211bca98bc3 |
comparison
equal
deleted
inserted
replaced
21906:b81818d441f7 | 21907:f4e21796f47d |
---|---|
562 check_script_var_type(typval_T *dest, typval_T *value, char_u *name) | 562 check_script_var_type(typval_T *dest, typval_T *value, char_u *name) |
563 { | 563 { |
564 scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid); | 564 scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid); |
565 int idx; | 565 int idx; |
566 | 566 |
567 if (si->sn_version != SCRIPT_VERSION_VIM9) | |
568 // legacy script doesn't store variable types | |
569 return OK; | |
570 | |
567 // Find the svar_T in sn_var_vals. | 571 // Find the svar_T in sn_var_vals. |
568 for (idx = 0; idx < si->sn_var_vals.ga_len; ++idx) | 572 for (idx = 0; idx < si->sn_var_vals.ga_len; ++idx) |
569 { | 573 { |
570 svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data) + idx; | 574 svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data) + idx; |
571 | 575 |