Mercurial > vim
comparison src/evalfunc.c @ 28806:3754393e05bc v8.2.4927
patch 8.2.4927: return type of remove() incorrect when using three arguments
Commit: https://github.com/vim/vim/commit/2ac037f54bb2588b7a86e61c9c6e9504884edbec
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 9 14:12:14 2022 +0100
patch 8.2.4927: return type of remove() incorrect when using three arguments
Problem: Return type of remove() incorrect when using three arguments.
Solution: Use first argument type when there are three arguments.
(closes #10387)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 09 May 2022 15:15:03 +0200 |
parents | 7fd3a9f05037 |
children | 18604231a1d1 |
comparison
equal
deleted
inserted
replaced
28805:2a1287ec767f | 28806:3754393e05bc |
---|---|
1418 } | 1418 } |
1419 | 1419 |
1420 static type_T * | 1420 static type_T * |
1421 ret_remove(int argcount, | 1421 ret_remove(int argcount, |
1422 type2_T *argtypes, | 1422 type2_T *argtypes, |
1423 type_T **decl_type UNUSED) | 1423 type_T **decl_type) |
1424 { | 1424 { |
1425 if (argcount > 0) | 1425 if (argcount > 0) |
1426 { | 1426 { |
1427 if (argtypes[0].type_curr->tt_type == VAR_LIST | 1427 if (argtypes[0].type_curr->tt_type == VAR_LIST |
1428 || argtypes[0].type_curr->tt_type == VAR_DICT) | 1428 || argtypes[0].type_curr->tt_type == VAR_DICT) |
1429 { | 1429 { |
1430 if (argcount == 3) | |
1431 { | |
1432 *decl_type = argtypes[0].type_decl; | |
1433 return argtypes[0].type_curr; | |
1434 } | |
1430 if (argtypes[0].type_curr->tt_type | 1435 if (argtypes[0].type_curr->tt_type |
1431 == argtypes[0].type_decl->tt_type) | 1436 == argtypes[0].type_decl->tt_type) |
1432 *decl_type = argtypes[0].type_decl->tt_member; | 1437 *decl_type = argtypes[0].type_decl->tt_member; |
1433 return argtypes[0].type_curr->tt_member; | 1438 return argtypes[0].type_curr->tt_member; |
1434 } | 1439 } |