diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-03-15 20:21:33 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-15 20:21:33 +0000 |
commit | 056678184f679c2989b73bd48eda112f3c79a62f (patch) | |
tree | 6c07b21e0c06adbf8672e3aa25ae912cc82fd2f1 /src/vim9instr.c | |
parent | 139575de6653e7fd5807cb036dfb3684b815c519 (diff) | |
download | vim-git-056678184f679c2989b73bd48eda112f3c79a62f.tar.gz |
patch 8.2.4576: Vim9: error for comparing with null can be annoyingv8.2.4576
Problem: Vim9: error for comparing with null can be annoying.
Solution: Allow comparing anything with null. (closes #9948)
Diffstat (limited to 'src/vim9instr.c')
-rw-r--r-- | src/vim9instr.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/vim9instr.c b/src/vim9instr.c index de144dcc1..48e7edfed 100644 --- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -397,20 +397,8 @@ get_compare_isn( vartype_name(vartype1), vartype_name(vartype2)); return ISN_DROP; } - switch (vartype1 == VAR_SPECIAL ? vartype2 : vartype1) - { - case VAR_BLOB: break; - case VAR_CHANNEL: break; - case VAR_DICT: break; - case VAR_FUNC: break; - case VAR_JOB: break; - case VAR_LIST: break; - case VAR_PARTIAL: break; - case VAR_STRING: break; - default: semsg(_(e_cannot_compare_str_with_str), - vartype_name(vartype1), vartype_name(vartype2)); - return ISN_DROP; - } + // although comparing null with number, float or bool is not useful, we + // allow it isntype = ISN_COMPARENULL; } |