Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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)
- Loading branch information
Showing
4 changed files
with
36 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1417,12 +1417,9 @@ typval_compare_null(typval_T *tv1, typval_T *tv2) | |
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 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
brammool
via email
Author
Contributor
|
||
// we won't give an error | ||
return FALSE; | ||
} | ||
|
||
/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Small typo in a comment in
src/typval.c
, line 1420: