0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.4529: Vim9: comparing partial with function fails

Problem:    Vim9: comparing partial with function fails.
Solution:   Support this comparison.  Avoid a crash. (closes #9909)
            Add more test cases.
This commit is contained in:
Bram Moolenaar
2022-03-08 19:43:55 +00:00
parent 673bcb10eb
commit ed0c62e7b1
8 changed files with 64 additions and 8 deletions

View File

@@ -370,7 +370,9 @@ get_compare_isn(exprtype_T exprtype, vartype_T type1, vartype_T type2)
}
else if (type1 == VAR_ANY || type2 == VAR_ANY
|| ((type1 == VAR_NUMBER || type1 == VAR_FLOAT)
&& (type2 == VAR_NUMBER || type2 == VAR_FLOAT)))
&& (type2 == VAR_NUMBER || type2 == VAR_FLOAT))
|| (type1 == VAR_FUNC && type2 == VAR_PARTIAL)
|| (type1 == VAR_PARTIAL && type2 == VAR_FUNC))
isntype = ISN_COMPAREANY;
else if (type1 == VAR_SPECIAL || type2 == VAR_SPECIAL)
{