0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.3310: Vim9: unpack assignment does not mention source of type error

Problem:    Vim9: unpack assignment does not mention source of type error.
Solution:   Mention the argument number. (closes #8719)
This commit is contained in:
Bram Moolenaar
2021-08-07 16:30:42 +02:00
parent fbeefb1b87
commit 4270d8b762
4 changed files with 63 additions and 28 deletions

View File

@@ -414,6 +414,22 @@ def Test_assign_unpack()
[x, y] = g:values
END
CheckDefExecAndScriptFailure(lines, 'E1163: Variable 2: type mismatch, expected string but got number')
lines =<< trim END
var x: number
var y: number
var z: string
[x, y, z] = [1, 2, 3]
END
CheckDefAndScriptFailure(lines, 'E1163: Variable 3: type mismatch, expected string but got number')
lines =<< trim END
var x: number
var y: string
var z: string
[x, y, z] = [1, '2', 3]
END
CheckDefExecAndScriptFailure(lines, 'E1163: Variable 3: type mismatch, expected string but got number')
enddef
def Test_assign_linebreak()