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)
diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim
index 8491a4d..a96e97c 100644
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -414,6 +414,22 @@
[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()