Mercurial > vim
comparison src/testdir/test_vim9_assign.vim @ 23707:6e8a4a30d94d v8.2.2395
patch 8.2.2395: Vim9: error for wrong type may report wrong line number
Commit: https://github.com/vim/vim/commit/9a562c184d98d82bb7506caf2071cfe15a92fa43
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 23 13:39:14 2021 +0100
patch 8.2.2395: Vim9: error for wrong type may report wrong line number
Problem: Vim9: error for wrong type may report wrong line number.
Solution: Save and restore the line number when evaluating the expression.
(closes #7727)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 23 Jan 2021 13:45:04 +0100 |
parents | e8c379b20765 |
children | 4b417b776b95 |
comparison
equal
deleted
inserted
replaced
23706:9f7e1c726d0e | 23707:6e8a4a30d94d |
---|---|
53 CheckDefAndScriptFailure(['var x: bool = 2'], 'E1012:') | 53 CheckDefAndScriptFailure(['var x: bool = 2'], 'E1012:') |
54 CheckDefAndScriptFailure(['var x: bool = -1'], 'E1012:') | 54 CheckDefAndScriptFailure(['var x: bool = -1'], 'E1012:') |
55 CheckDefAndScriptFailure(['var x: bool = [1]'], 'E1012:') | 55 CheckDefAndScriptFailure(['var x: bool = [1]'], 'E1012:') |
56 CheckDefAndScriptFailure(['var x: bool = {}'], 'E1012:') | 56 CheckDefAndScriptFailure(['var x: bool = {}'], 'E1012:') |
57 CheckDefAndScriptFailure(['var x: bool = "x"'], 'E1012:') | 57 CheckDefAndScriptFailure(['var x: bool = "x"'], 'E1012:') |
58 | |
59 CheckDefAndScriptFailure(['var x: bool = "x"', '', 'eval 0'], 'E1012:', 1) | |
58 enddef | 60 enddef |
59 | 61 |
60 def Test_syntax() | 62 def Test_syntax() |
61 var name = 234 | 63 var name = 234 |
62 var other: list<string> = ['asdf'] | 64 var other: list<string> = ['asdf'] |