patch 8.2.3060: Vim9: cannot use ternary operator in parenthesis
Problem: Vim9: cannot use ternary operator in parenthesis.
Solution: Do not use "=~" for a default argument value. (closes #8462)
diff --git a/src/userfunc.c b/src/userfunc.c
index c8d08bb..4756bf9 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -275,9 +275,10 @@
break;
// Recognize " = expr" but not " == expr". A lambda can have
- // "(a = expr" but "(a == expr" is not a lambda.
+ // "(a = expr" but "(a == expr" and "(a =~ expr" are not a lambda.
np = skipwhite(p);
- if (*np == '=' && np[1] != '=' && default_args != NULL)
+ if (*np == '=' && np[1] != '=' && np[1] != '~'
+ && default_args != NULL)
{
typval_T rettv;