diff src/typval.c @ 28103:1615d305c71d v8.2.4576

patch 8.2.4576: Vim9: error for comparing with null can be annoying Commit: https://github.com/vim/vim/commit/056678184f679c2989b73bd48eda112f3c79a62f Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 15 20:21:33 2022 +0000 patch 8.2.4576: Vim9: error for comparing with null can be annoying Problem: Vim9: error for comparing with null can be annoying. Solution: Allow comparing anything with null. (closes https://github.com/vim/vim/issues/9948)
author Bram Moolenaar <Bram@vim.org>
date Tue, 15 Mar 2022 21:30:03 +0100
parents 53e2bf6032e5
children 662d2d5db9a6
line wrap: on
line diff
--- a/src/typval.c
+++ b/src/typval.c
@@ -1417,12 +1417,9 @@ typval_compare_null(typval_T *tv1, typva
 	    default: break;
 	}
     }
-    if (!in_vim9script())
-	return FALSE;  // backwards compatible
-
-    semsg(_(e_cannot_compare_str_with_str),
-			 vartype_name(tv1->v_type), vartype_name(tv2->v_type));
-    return MAYBE;
+    // although comparing null with number, float or bool is not very usefule
+    // we won't give an error
+    return FALSE;
 }
 
 /*