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:
@@ -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
|
||||
|
Reference in New Issue
Block a user