comparison src/vim9script.c @ 23332:cdb706d5c43d v8.2.2209

patch 8.2.2209: Vim9: return type of => lambda not parsed Commit: https://github.com/vim/vim/commit/9e68c32563d8c9ffe1ac04ecd4ccd730af66b97c Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 25 12:38:04 2020 +0100 patch 8.2.2209: Vim9: return type of => lambda not parsed Problem: Vim9: return type of => lambda not parsed. Solution: Parse and use the return type.
author Bram Moolenaar <Bram@vim.org>
date Fri, 25 Dec 2020 12:45:05 +0100
parents 8b93aea8d9d7
children b3142fc0a414
comparison
equal deleted inserted replaced
23331:c5b1246b9557 23332:cdb706d5c43d
509 { 509 {
510 char_u *p; 510 char_u *p;
511 char_u *name; 511 char_u *name;
512 scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid); 512 scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
513 type_T *type; 513 type_T *type;
514 int called_emsg_before = called_emsg;
515 typval_T init_tv; 514 typval_T init_tv;
516 515
517 if (eap->cmdidx == CMD_final || eap->cmdidx == CMD_const) 516 if (eap->cmdidx == CMD_final || eap->cmdidx == CMD_const)
518 { 517 {
519 if (eap->cmdidx == CMD_final) 518 if (eap->cmdidx == CMD_final)
546 } 545 }
547 name = vim_strnsave(arg, p - arg); 546 name = vim_strnsave(arg, p - arg);
548 547
549 // parse type 548 // parse type
550 p = skipwhite(p + 1); 549 p = skipwhite(p + 1);
551 type = parse_type(&p, &si->sn_type_list); 550 type = parse_type(&p, &si->sn_type_list, TRUE);
552 if (called_emsg != called_emsg_before) 551 if (type == NULL)
553 { 552 {
554 vim_free(name); 553 vim_free(name);
555 return p; 554 return p;
556 } 555 }
557 556