comparison src/typval.c @ 22930:84567584951f v8.2.2012

patch 8.2.2012: Vim9: confusing error message when using bool wrongly Commit: https://github.com/vim/vim/commit/d92cc130fbb1beacf6411ee5837545f46f9be90e Author: Bram Moolenaar <Bram@vim.org> Date: Wed Nov 18 17:17:15 2020 +0100 patch 8.2.2012: Vim9: confusing error message when using bool wrongly Problem: Vim9: confusing error message when using bool wrongly. Solution: Mention "Bool" instead of "Special". (closes https://github.com/vim/vim/issues/7323)
author Bram Moolenaar <Bram@vim.org>
date Wed, 18 Nov 2020 17:30:04 +0100
parents 53acb89ec9f2
children 5f08d4a42898
comparison
equal deleted inserted replaced
22929:401512a04eec 22930:84567584951f
211 break; 211 break;
212 case VAR_BOOL: 212 case VAR_BOOL:
213 case VAR_SPECIAL: 213 case VAR_SPECIAL:
214 if (!want_bool && in_vim9script()) 214 if (!want_bool && in_vim9script())
215 { 215 {
216 emsg(_("E611: Using a Special as a Number")); 216 if (varp->v_type == VAR_BOOL)
217 emsg(_(e_using_bool_as_number));
218 else
219 emsg(_("E611: Using a Special as a Number"));
217 break; 220 break;
218 } 221 }
219 return varp->vval.v_number == VVAL_TRUE ? 1 : 0; 222 return varp->vval.v_number == VVAL_TRUE ? 1 : 0;
220 case VAR_JOB: 223 case VAR_JOB:
221 #ifdef FEAT_JOB_CHANNEL 224 #ifdef FEAT_JOB_CHANNEL