Mercurial > vim
comparison src/evalfunc.c @ 26741:59dde78e9436 v8.2.3899
patch 8.2.3899: Vim9: test for map() on string fails
Commit: https://github.com/vim/vim/commit/ec86520f946a40d5c4a92d6a11d6928faa13abd4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 25 22:10:42 2021 +0000
patch 8.2.3899: Vim9: test for map() on string fails
Problem: Vim9: test for map() on string fails.
Solution: Expect string return type.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 Dec 2021 23:15:04 +0100 |
parents | 10d3105030ab |
children | 4ea53126f78f |
comparison
equal
deleted
inserted
replaced
26740:9ed6ad5a8a73 | 26741:59dde78e9436 |
---|---|
515 type_T *expected = NULL; | 515 type_T *expected = NULL; |
516 | 516 |
517 if (context->arg_types[0]->tt_type == VAR_LIST | 517 if (context->arg_types[0]->tt_type == VAR_LIST |
518 || context->arg_types[0]->tt_type == VAR_DICT) | 518 || context->arg_types[0]->tt_type == VAR_DICT) |
519 expected = context->arg_types[0]->tt_member; | 519 expected = context->arg_types[0]->tt_member; |
520 else if (context->arg_types[0]->tt_type == VAR_STRING | 520 else if (context->arg_types[0]->tt_type == VAR_STRING) |
521 || context->arg_types[0]->tt_type == VAR_BLOB) | 521 expected = &t_string; |
522 else if (context->arg_types[0]->tt_type == VAR_BLOB) | |
522 expected = &t_number; | 523 expected = &t_number; |
523 if (expected != NULL) | 524 if (expected != NULL) |
524 { | 525 { |
525 type_T t_func_exp = {VAR_FUNC, -1, 0, TTFLAG_STATIC, | 526 type_T t_func_exp = {VAR_FUNC, -1, 0, TTFLAG_STATIC, |
526 expected, NULL}; | 527 expected, NULL}; |