Mercurial > vim
comparison src/testdir/test_vim9_assign.vim @ 22431:685909aa5641 v8.2.1764
patch 8.2.1764: Vim9: no error when assigning to script var with wrong type
Commit: https://github.com/vim/vim/commit/06f9c6940a88d132c85eb2a1b5034fa7653518ce
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 27 21:27:40 2020 +0200
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 https://github.com/vim/vim/issues/7028)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 27 Sep 2020 21:30:08 +0200 |
parents | eabc059a6ac4 |
children | 8b5e2f9580db |
comparison
equal
deleted
inserted
replaced
22430:80be8e5a6b18 | 22431:685909aa5641 |
---|---|
565 assert_equal(43, w) | 565 assert_equal(43, w) |
566 var t: number = 44 | 566 var t: number = 44 |
567 assert_equal(44, t) | 567 assert_equal(44, t) |
568 END | 568 END |
569 CheckScriptSuccess(lines) | 569 CheckScriptSuccess(lines) |
570 | |
571 lines =<< trim END | |
572 vim9script | |
573 var n: number | |
574 def Func() | |
575 n = 'string' | |
576 enddef | |
577 defcompile | |
578 END | |
579 CheckScriptFailure(lines, 'E1012: Type mismatch; expected number but got string') | |
570 enddef | 580 enddef |
571 | 581 |
572 def Mess(): string | 582 def Mess(): string |
573 v:foldstart = 123 | 583 v:foldstart = 123 |
574 return 'xxx' | 584 return 'xxx' |