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.
diff --git a/src/vim9instr.c b/src/vim9instr.c
index 7fbf529..e36ea16 100644
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -370,7 +370,9 @@
}
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)
{