Mercurial > vim
diff src/testdir/test_vim9_assign.vim @ 25405:747ebbce2421 v8.2.3239
patch 8.2.3239: Vim9: no error using heredoc for a number variable
Commit: https://github.com/vim/vim/commit/81530e36033dec2c2cd94af6dd48ceb0389e95a2
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 28 21:25:49 2021 +0200
patch 8.2.3239: Vim9: no error using heredoc for a number variable
Problem: Vim9: no error using heredoc for a number variable.
Solution: Add a type check. (closes https://github.com/vim/vim/issues/8627)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 28 Jul 2021 21:30:04 +0200 |
parents | 5c7192180b89 |
children | 21b70bab366c |
line wrap: on
line diff
--- a/src/testdir/test_vim9_assign.vim +++ b/src/testdir/test_vim9_assign.vim @@ -1392,6 +1392,14 @@ def Test_heredoc() [END] CheckScriptFailure(lines, 'E1145: Missing heredoc end marker: END') delfunc! g:Func + + lines =<< trim END + var lines: number =<< trim STOP + aaa + bbb + STOP + END + CheckDefAndScriptFailure(lines, 'E1012: Type mismatch; expected number but got list<string>', 1) enddef def Test_var_func_call()