0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

patch 8.2.0570: Vim9: no error when omitting type from argument

Problem:    Vim9: no error when omitting type from argument.
Solution:   Enforce specifying argument types.
This commit is contained in:
Bram Moolenaar
2020-04-13 17:21:00 +02:00
parent fbda69b309
commit 6e949784be
7 changed files with 30 additions and 12 deletions

View File

@@ -859,11 +859,11 @@ def Test_expr7_negate()
assert_equal(88, --nr)
enddef
def Echo(arg): string
def Echo(arg: any): string
return arg
enddef
def s:EchoArg(arg): string
def s:EchoArg(arg: any): string
return arg
enddef
@@ -991,6 +991,7 @@ def Test_expr7_trailing()
assert_equal(123, d.key)
enddef
func Test_expr7_trailing_fails()
call CheckDefFailureList(['let l = [2]', 'l->{l -> add(l, 8)}'], 'E107')
call CheckDefFailureList(['let l = [2]', 'l->{l -> add(l, 8)} ()'], 'E274')