Mercurial > vim
comparison src/dict.c @ 25326:cfbf40f749b0 v8.2.3200
patch 8.2.3200: Vim9: hard to guess where a type error is given
Commit: https://github.com/vim/vim/commit/7a3fe3e180bdbce8f193abdf399559c5154bdaae
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 22 14:58:47 2021 +0200
patch 8.2.3200: Vim9: hard to guess where a type error is given
Problem: Vim9: hard to guess where a type error is given.
Solution: Add the function name where possible. (closes https://github.com/vim/vim/issues/8608)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 22 Jul 2021 15:00:05 +0200 |
parents | 4d3c68196d05 |
children | e2be9f3c5907 |
comparison
equal
deleted
inserted
replaced
25325:6d48afa9f12d | 25326:cfbf40f749b0 |
---|---|
1071 * When "action" is "error" then a duplicate key is an error. | 1071 * When "action" is "error" then a duplicate key is an error. |
1072 * When "action" is "force" then a duplicate key is overwritten. | 1072 * When "action" is "force" then a duplicate key is overwritten. |
1073 * Otherwise duplicate keys are ignored ("action" is "keep"). | 1073 * Otherwise duplicate keys are ignored ("action" is "keep"). |
1074 */ | 1074 */ |
1075 void | 1075 void |
1076 dict_extend(dict_T *d1, dict_T *d2, char_u *action) | 1076 dict_extend(dict_T *d1, dict_T *d2, char_u *action, char *func_name) |
1077 { | 1077 { |
1078 dictitem_T *di1; | 1078 dictitem_T *di1; |
1079 hashitem_T *hi2; | 1079 hashitem_T *hi2; |
1080 int todo; | 1080 int todo; |
1081 char_u *arg_errmsg = (char_u *)N_("extend() argument"); | 1081 char_u *arg_errmsg = (char_u *)N_("extend() argument"); |
1104 if (!valid_varname(hi2->hi_key, TRUE)) | 1104 if (!valid_varname(hi2->hi_key, TRUE)) |
1105 break; | 1105 break; |
1106 } | 1106 } |
1107 | 1107 |
1108 if (type != NULL | 1108 if (type != NULL |
1109 && check_typval_arg_type(type, &HI2DI(hi2)->di_tv, 0) | 1109 && check_typval_arg_type(type, &HI2DI(hi2)->di_tv, |
1110 == FAIL) | 1110 func_name, 0) == FAIL) |
1111 break; | 1111 break; |
1112 | 1112 |
1113 if (di1 == NULL) | 1113 if (di1 == NULL) |
1114 { | 1114 { |
1115 di1 = dictitem_copy(HI2DI(hi2)); | 1115 di1 = dictitem_copy(HI2DI(hi2)); |