1
0
forked from aniani/vim

patch 8.2.0563: Vim9: cannot split a function line

Problem:    Vim9: cannot split a function line.
Solution:   Continue in next line so long as the function isn't done.
This commit is contained in:
Bram Moolenaar
2020-04-12 21:53:00 +02:00
parent 9c7e6dd653
commit 5e774c7579
6 changed files with 69 additions and 12 deletions

View File

@@ -561,6 +561,22 @@ def Test_func_return_type()
CheckDefFailure(['let str: string', 'str = FuncNoArgRetNumber()'], 'E1013: type mismatch, expected string but got number')
enddef
def MultiLine(
arg1: string,
arg2 = 1234,
...rest: list<string>
): string
return arg1 .. arg2 .. join(rest, '-')
enddef
def Test_multiline()
assert_equal('text1234', MultiLine('text'))
assert_equal('text777', MultiLine('text', 777))
assert_equal('text777one', MultiLine('text', 777, 'one'))
assert_equal('text777one-two', MultiLine('text', 777, 'one', 'two'))
enddef
" When using CheckScriptFailure() for the below test, E1010 is generated instead
" of E1056.
func Test_E1056_1059()