Mercurial > vim
comparison src/testdir/test_vim9_func.vim @ 21170:8c494353c6bc v8.2.1136
patch 8.2.1136: Vim9: return type of argv() is always any
Commit: https://github.com/vim/vim/commit/846178a72ca0860073d47fc0dc95f98d15f1d921
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 5 17:04:13 2020 +0200
patch 8.2.1136: Vim9: return type of argv() is always any
Problem: Vim9: return type of argv() is always any.
Solution: Use list<string> if there is no argument.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 Jul 2020 17:15:03 +0200 |
parents | 4a190861f0cc |
children | 96ae8622cfb6 |
comparison
equal
deleted
inserted
replaced
21169:93bfa89a916f | 21170:8c494353c6bc |
---|---|
608 res += n | 608 res += n |
609 endfor | 609 endfor |
610 assert_equal(6, res) | 610 assert_equal(6, res) |
611 enddef | 611 enddef |
612 | 612 |
613 def Test_argv_return_type() | |
614 next fileone filetwo | |
615 let res = '' | |
616 for name in argv() | |
617 res ..= name | |
618 endfor | |
619 assert_equal('fileonefiletwo', res) | |
620 enddef | |
621 | |
613 def Test_func_type_part() | 622 def Test_func_type_part() |
614 let RefVoid: func: void | 623 let RefVoid: func: void |
615 RefVoid = FuncNoArgNoRet | 624 RefVoid = FuncNoArgNoRet |
616 RefVoid = FuncOneArgNoRet | 625 RefVoid = FuncOneArgNoRet |
617 CheckDefFailure(['let RefVoid: func: void', 'RefVoid = FuncNoArgRetNumber'], 'E1013: type mismatch, expected func() but got func(): number') | 626 CheckDefFailure(['let RefVoid: func: void', 'RefVoid = FuncNoArgRetNumber'], 'E1013: type mismatch, expected func() but got func(): number') |