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 #9948)
diff --git a/src/typval.c b/src/typval.c
index e0511be..d0c937e 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -1417,12 +1417,9 @@
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;
}
/*