comparison src/vim9execute.c @ 22004:a9e60176dcd3 v8.2.1551

patch 8.2.1551: Vim9: error for argument type does not mention the number Commit: https://github.com/vim/vim/commit/8b565c2c1522e0c41e3d18e1bb6e1bc4b3686842 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 30 23:24:20 2020 +0200 patch 8.2.1551: Vim9: error for argument type does not mention the number Problem: Vim9: error for argument type does not mention the number. Solution: Pass the argument number to where the error is given.
author Bram Moolenaar <Bram@vim.org>
date Sun, 30 Aug 2020 23:30:04 +0200
parents 3fe594c72d8c
children 6941d3205be9
comparison
equal deleted inserted replaced
22003:b22488a6de96 22004:a9e60176dcd3
790 790
791 // Put arguments on the stack. 791 // Put arguments on the stack.
792 for (idx = 0; idx < argc; ++idx) 792 for (idx = 0; idx < argc; ++idx)
793 { 793 {
794 if (ufunc->uf_arg_types != NULL && idx < ufunc->uf_args.ga_len 794 if (ufunc->uf_arg_types != NULL && idx < ufunc->uf_args.ga_len
795 && check_typval_type(ufunc->uf_arg_types[idx], &argv[idx]) 795 && check_typval_type(ufunc->uf_arg_types[idx], &argv[idx],
796 == FAIL) 796 idx + 1) == FAIL)
797 goto failed_early; 797 goto failed_early;
798 copy_tv(&argv[idx], STACK_TV_BOT(0)); 798 copy_tv(&argv[idx], STACK_TV_BOT(0));
799 ++ectx.ec_stack.ga_len; 799 ++ectx.ec_stack.ga_len;
800 } 800 }
801 801
820 type_T *expected = ufunc->uf_va_type->tt_member; 820 type_T *expected = ufunc->uf_va_type->tt_member;
821 listitem_T *li = tv->vval.v_list->lv_first; 821 listitem_T *li = tv->vval.v_list->lv_first;
822 822
823 for (idx = 0; idx < vararg_count; ++idx) 823 for (idx = 0; idx < vararg_count; ++idx)
824 { 824 {
825 if (check_typval_type(expected, &li->li_tv) == FAIL) 825 if (check_typval_type(expected, &li->li_tv,
826 argc + idx + 1) == FAIL)
826 goto failed_early; 827 goto failed_early;
827 li = li->li_next; 828 li = li->li_next;
828 } 829 }
829 } 830 }
830 831