comparison src/vim9execute.c @ 24614:07b3d21a8b4b v8.2.2846

patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void Commit: https://github.com/vim/vim/commit/68db996b621b98066fb7ab7028ed5c6aaa3954a8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 9 23:19:22 2021 +0200 patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void Problem: Vim9: "echo Func()" does not give an error for a function without a return value. Solution: Give an error. Be more specific about why a value is invalid.
author Bram Moolenaar <Bram@vim.org>
date Sun, 09 May 2021 23:30:05 +0200
parents a4fda40e0bb9
children 4a4f64cdc798
comparison
equal deleted inserted replaced
24613:2ccff0c26a2f 24614:07b3d21a8b4b
1576 { 1576 {
1577 if (tv->v_type == VAR_CHANNEL 1577 if (tv->v_type == VAR_CHANNEL
1578 || tv->v_type == VAR_JOB) 1578 || tv->v_type == VAR_JOB)
1579 { 1579 {
1580 SOURCING_LNUM = iptr->isn_lnum; 1580 SOURCING_LNUM = iptr->isn_lnum;
1581 emsg(_(e_inval_string)); 1581 semsg(_(e_using_invalid_value_as_string_str),
1582 vartype_name(tv->v_type));
1582 break; 1583 break;
1583 } 1584 }
1584 else 1585 else
1585 p = tv_get_string_buf(tv, buf); 1586 p = tv_get_string_buf(tv, buf);
1586 } 1587 }