Mercurial > vim
comparison src/userfunc.c @ 14002:ade79e3e3b88 v8.1.0019
patch 8.1.0019: error when defining a Lambda with index of a function result
commit https://github.com/vim/vim/commit/b4518563c73460150344a57879bf5b22cb8b1c77
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 22 18:31:35 2018 +0200
patch 8.1.0019: error when defining a Lambda with index of a function result
Problem: Error when defining a Lambda with index of a function result.
Solution: When not evaluating an expression and skipping a function call,
set the return value to VAR_UNKNOWN.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 22 May 2018 18:45:05 +0200 |
parents | 69517d67421f |
children | 706b57cd1b00 |
comparison
equal
deleted
inserted
replaced
14001:4a78b9913023 | 14002:ade79e3e3b88 |
---|---|
1347 argcount = partial->pt_argc + argcount_in; | 1347 argcount = partial->pt_argc + argcount_in; |
1348 } | 1348 } |
1349 } | 1349 } |
1350 | 1350 |
1351 | 1351 |
1352 /* execute the function if no errors detected and executing */ | 1352 /* |
1353 if (evaluate && error == ERROR_NONE) | 1353 * Execute the function if executing and no errors were detected. |
1354 */ | |
1355 if (!evaluate) | |
1356 { | |
1357 // Not evaluating, which means the return value is unknown. This | |
1358 // matters for giving error messages. | |
1359 rettv->v_type = VAR_UNKNOWN; | |
1360 } | |
1361 else if (error == ERROR_NONE) | |
1354 { | 1362 { |
1355 char_u *rfname = fname; | 1363 char_u *rfname = fname; |
1356 | 1364 |
1357 /* Ignore "g:" before a function name. */ | 1365 /* Ignore "g:" before a function name. */ |
1358 if (fname[0] == 'g' && fname[1] == ':') | 1366 if (fname[0] == 'g' && fname[1] == ':') |