comparison src/testdir/test_vim9_assign.vim @ 25547:ec4df0b982da v8.2.3310

patch 8.2.3310: Vim9: unpack assignment does not mention source of type error Commit: https://github.com/vim/vim/commit/4270d8b7626ff8a7006f6a09c89bc446a3f89d1e Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 7 16:30:42 2021 +0200 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 https://github.com/vim/vim/issues/8719)
author Bram Moolenaar <Bram@vim.org>
date Sat, 07 Aug 2021 16:45:03 +0200
parents f7db86111acd
children ea69398b40d1
comparison
equal deleted inserted replaced
25546:465989ba8936 25547:ec4df0b982da
412 var x: bool 412 var x: bool
413 var y: string 413 var y: string
414 [x, y] = g:values 414 [x, y] = g:values
415 END 415 END
416 CheckDefExecAndScriptFailure(lines, 'E1163: Variable 2: type mismatch, expected string but got number') 416 CheckDefExecAndScriptFailure(lines, 'E1163: Variable 2: type mismatch, expected string but got number')
417
418 lines =<< trim END
419 var x: number
420 var y: number
421 var z: string
422 [x, y, z] = [1, 2, 3]
423 END
424 CheckDefAndScriptFailure(lines, 'E1163: Variable 3: type mismatch, expected string but got number')
425
426 lines =<< trim END
427 var x: number
428 var y: string
429 var z: string
430 [x, y, z] = [1, '2', 3]
431 END
432 CheckDefExecAndScriptFailure(lines, 'E1163: Variable 3: type mismatch, expected string but got number')
417 enddef 433 enddef
418 434
419 def Test_assign_linebreak() 435 def Test_assign_linebreak()
420 var nr: number 436 var nr: number
421 nr = 437 nr =