0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.1764: Vim9: no error when assigning to script var with wrong type

Problem:    Vim9: no error when assigning to script var with wrong type.
Solution:   Fix off-by-one error. (closes #7028)
This commit is contained in:
Bram Moolenaar
2020-09-27 21:27:40 +02:00
parent 6c542f77eb
commit 06f9c6940a
3 changed files with 13 additions and 1 deletions

View File

@@ -567,6 +567,16 @@ def Test_assignment_vim9script()
assert_equal(44, t)
END
CheckScriptSuccess(lines)
lines =<< trim END
vim9script
var n: number
def Func()
n = 'string'
enddef
defcompile
END
CheckScriptFailure(lines, 'E1012: Type mismatch; expected number but got string')
enddef
def Mess(): string