comparison src/vim9type.c @ 30737:ec54b510e5ee v9.0.0703

patch 9.0.0703: failing check for argument type for const any Commit: https://github.com/vim/vim/commit/330d64d32cbb8ba7cdfe8dc0bedd4caff3bb01e8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 9 12:55:33 2022 +0100 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 https://github.com/vim/vim/issues/11316)
author Bram Moolenaar <Bram@vim.org>
date Sun, 09 Oct 2022 14:00:03 +0200
parents 4a1b0a12b430
children 307f68a41b03
comparison
equal deleted inserted replaced
30736:78482941c68c 30737:ec54b510e5ee
332 return FAIL; 332 return FAIL;
333 ((type_T **)type_gap->ga_data)[type_gap->ga_len] = 333 ((type_T **)type_gap->ga_data)[type_gap->ga_len] =
334 (void *)functype->tt_args; 334 (void *)functype->tt_args;
335 ++type_gap->ga_len; 335 ++type_gap->ga_len;
336 return OK; 336 return OK;
337 }
338
339 /*
340 * Return TRUE if "type" is NULL, any or unknown.
341 * This also works for const (comparing with &t_any and &t_unknown doesn't).
342 */
343 int
344 type_any_or_unknown(type_T *type)
345 {
346 return type == NULL || type->tt_type == VAR_ANY
347 || type->tt_type == VAR_UNKNOWN;
337 } 348 }
338 349
339 /* 350 /*
340 * Get a type_T for a typval_T. 351 * Get a type_T for a typval_T.
341 * "type_gap" is used to temporarily create types in. 352 * "type_gap" is used to temporarily create types in.