diff 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
line wrap: on
line diff
--- a/src/typval.c
+++ b/src/typval.c
@@ -213,7 +213,10 @@ tv_get_bool_or_number_chk(typval_T *varp
 	case VAR_SPECIAL:
 	    if (!want_bool && in_vim9script())
 	    {
-		emsg(_("E611: Using a Special as a Number"));
+		if (varp->v_type == VAR_BOOL)
+		    emsg(_(e_using_bool_as_number));
+		else
+		    emsg(_("E611: Using a Special as a Number"));
 		break;
 	    }
 	    return varp->vval.v_number == VVAL_TRUE ? 1 : 0;