1
0
forked from aniani/vim

patch 9.0.0703: failing check for argument type for const any

Problem:    Failing check for argument type for const any.
Solution:   Check for any type properly. (closes #11316)
This commit is contained in:
Bram Moolenaar
2022-10-09 12:55:33 +01:00
parent 30c0c467d6
commit 330d64d32c
5 changed files with 110 additions and 107 deletions

View File

@@ -336,6 +336,17 @@ func_type_add_arg_types(
return OK;
}
/*
* Return TRUE if "type" is NULL, any or unknown.
* This also works for const (comparing with &t_any and &t_unknown doesn't).
*/
int
type_any_or_unknown(type_T *type)
{
return type == NULL || type->tt_type == VAR_ANY
|| type->tt_type == VAR_UNKNOWN;
}
/*
* Get a type_T for a typval_T.
* "type_gap" is used to temporarily create types in.