comparison src/testdir/test_vim9_assign.vim @ 27569:f40647a2b36a v8.2.4311

patch 8.2.4311: Vim9: changing script variable type not caught compile time Commit: https://github.com/vim/vim/commit/160afdb1850b8cf56dc8e94acee7a04bc2113992 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 6 17:17:02 2022 +0000 patch 8.2.4311: Vim9: changing script variable type not caught compile time Problem: Vim9: changing script variable type not caught at compile time. Solution: Set the declared type.
author Bram Moolenaar <Bram@vim.org>
date Sun, 06 Feb 2022 18:30:04 +0100
parents ce4c2f4ce1f9
children 5c4ab8d4472c
comparison
equal deleted inserted replaced
27568:efccea5925bc 27569:f40647a2b36a
690 g:myList->extend([1]) 690 g:myList->extend([1])
691 g:myList->extend(['x']) 691 g:myList->extend(['x'])
692 END 692 END
693 v9.CheckDefExecAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>', 4) 693 v9.CheckDefExecAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>', 4)
694 unlet g:myList 694 unlet g:myList
695
696 lines =<< trim END
697 vim9script
698 var lds = [1, 2, 3]
699 def Func()
700 echo lds->extend(['x'])
701 enddef
702 defcompile
703 END
704 v9.CheckScriptFailure(lines, 'E1013:')
695 enddef 705 enddef
696 706
697 def Test_extend_dict() 707 def Test_extend_dict()
698 var lines =<< trim END 708 var lines =<< trim END
699 vim9script 709 vim9script