Mercurial > vim
comparison src/testdir/test_vim9_cmd.vim @ 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 | acd9220bdd0b |
children | 28127371aa18 |
comparison
equal
deleted
inserted
replaced
24613:2ccff0c26a2f | 24614:07b3d21a8b4b |
---|---|
1280 redir END | 1280 redir END |
1281 END | 1281 END |
1282 CheckDefFailure(lines, 'E1141:') | 1282 CheckDefFailure(lines, 'E1141:') |
1283 enddef | 1283 enddef |
1284 | 1284 |
1285 def Test_echo_void() | |
1286 var lines =<< trim END | |
1287 vim9script | |
1288 def NoReturn() | |
1289 echo 'nothing' | |
1290 enddef | |
1291 echo NoReturn() | |
1292 END | |
1293 CheckScriptFailure(lines, 'E1186:', 5) | |
1294 | |
1295 lines =<< trim END | |
1296 vim9script | |
1297 def NoReturn() | |
1298 echo 'nothing' | |
1299 enddef | |
1300 def Try() | |
1301 echo NoReturn() | |
1302 enddef | |
1303 defcompile | |
1304 END | |
1305 CheckScriptFailure(lines, 'E1186:', 1) | |
1306 enddef | |
1307 | |
1285 | 1308 |
1286 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker | 1309 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |