Mercurial > vim
diff src/testdir/test_vim9_assign.vim @ 33632:2c66a4fe1513 v9.0.2057
patch 9.0.2057: Vim9: no strict type checks for funcrefs varargs
Commit: https://github.com/vim/vim/commit/3ec6c1fe3bb1b366b710d3e7226f7eed3be1801a
Author: Ernie Rael <errael@raelity.com>
Date: Sat Oct 21 11:45:38 2023 +0200
patch 9.0.2057: Vim9: no strict type checks for funcrefs varargs
Problem: Vim9: no strict type checks for funcrefs varargs
Solution: Perform strict type checking when declaring funcrefs
with vararg declaration, add tests
closes: #13397
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 21 Oct 2023 12:00:03 +0200 |
parents | 1fcb7c9dc546 |
children | fcc8296f36eb |
line wrap: on
line diff
--- a/src/testdir/test_vim9_assign.vim +++ b/src/testdir/test_vim9_assign.vim @@ -1890,7 +1890,7 @@ def Test_assign_funcref_args() var FuncAnyVA: func(...any): number FuncAnyVA = (v): number => v END - v9.CheckScriptFailure(lines, 'E1012: Type mismatch; expected func(...any): number but got func(any): number') + v9.CheckScriptFailure(lines, 'E1180: Variable arguments type must be a list: any') # varargs must match lines =<< trim END @@ -1898,7 +1898,7 @@ def Test_assign_funcref_args() var FuncAnyVA: func(...any): number FuncAnyVA = (v1, v2): number => v1 + v2 END - v9.CheckScriptFailure(lines, 'E1012: Type mismatch; expected func(...any): number but got func(any, any): number') + v9.CheckScriptFailure(lines, 'E1180: Variable arguments type must be a list: any') # varargs must match lines =<< trim END @@ -1906,7 +1906,7 @@ def Test_assign_funcref_args() var FuncAnyVA: func(...any): number FuncAnyVA = (v1: list<any>): number => 3 END - v9.CheckScriptFailure(lines, 'E1012: Type mismatch; expected func(...any): number but got func(list<any>): number') + v9.CheckScriptFailure(lines, 'E1180: Variable arguments type must be a list: any') enddef def Test_assign_funcref_arg_any()