Mercurial > vim
comparison src/userfunc.c @ 21969:ba2415df82d7 v8.2.1534
patch 8.2.1534: Vim9: type error for argument type is not at call position
Commit: https://github.com/vim/vim/commit/ee8580e52e767916e2a95e8ac0732fd8a5ae0651
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 28 17:19:07 2020 +0200
patch 8.2.1534: Vim9: type error for argument type is not at call position
Problem: Vim9: type error for argument type is not at call position.
Solution: Set the context and stack after checking the arguments.
(issue #6785)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 28 Aug 2020 17:30:04 +0200 |
parents | a211bca98bc3 |
children | 3fe594c72d8c |
comparison
equal
deleted
inserted
replaced
21968:613ecf205d6a | 21969:ba2415df82d7 |
---|---|
1312 ga_init2(&fc->fc_funcs, sizeof(ufunc_T *), 1); | 1312 ga_init2(&fc->fc_funcs, sizeof(ufunc_T *), 1); |
1313 func_ptr_ref(fp); | 1313 func_ptr_ref(fp); |
1314 | 1314 |
1315 if (fp->uf_def_status != UF_NOT_COMPILED) | 1315 if (fp->uf_def_status != UF_NOT_COMPILED) |
1316 { | 1316 { |
1317 estack_push_ufunc(fp, 1); | |
1318 save_current_sctx = current_sctx; | |
1319 current_sctx = fp->uf_script_ctx; | |
1320 | |
1321 // Execute the function, possibly compiling it first. | 1317 // Execute the function, possibly compiling it first. |
1322 call_def_function(fp, argcount, argvars, funcexe->partial, rettv); | 1318 call_def_function(fp, argcount, argvars, funcexe->partial, rettv); |
1323 --depth; | 1319 --depth; |
1324 current_funccal = fc->caller; | 1320 current_funccal = fc->caller; |
1325 | |
1326 estack_pop(); | |
1327 current_sctx = save_current_sctx; | |
1328 free_funccal(fc); | 1321 free_funccal(fc); |
1329 return; | 1322 return; |
1330 } | 1323 } |
1331 | 1324 |
1332 if (STRNCMP(fp->uf_name, "<lambda>", 8) == 0) | 1325 if (STRNCMP(fp->uf_name, "<lambda>", 8) == 0) |