patch 8.2.3269: Vim9: wrong argument check for partial
Problem: Vim9: wrong argument check for partial. (Naohiro Ono)
Solution: Handle getting return type without arguments. Correct the minimal
number of arguments for what is included in the partial.
(closes #8667)
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 144797e..7e7ce35 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -2582,24 +2582,31 @@
enddef
def Test_partial_call()
- var Xsetlist = function('setloclist', [0])
- Xsetlist([], ' ', {title: 'test'})
- getloclist(0, {title: 1})->assert_equal({title: 'test'})
+ var lines =<< trim END
+ var Xsetlist: func
+ Xsetlist = function('setloclist', [0])
+ Xsetlist([], ' ', {title: 'test'})
+ getloclist(0, {title: 1})->assert_equal({title: 'test'})
- Xsetlist = function('setloclist', [0, [], ' '])
- Xsetlist({title: 'test'})
- getloclist(0, {title: 1})->assert_equal({title: 'test'})
+ Xsetlist = function('setloclist', [0, [], ' '])
+ Xsetlist({title: 'test'})
+ getloclist(0, {title: 1})->assert_equal({title: 'test'})
- Xsetlist = function('setqflist')
- Xsetlist([], ' ', {title: 'test'})
- getqflist({title: 1})->assert_equal({title: 'test'})
+ Xsetlist = function('setqflist')
+ Xsetlist([], ' ', {title: 'test'})
+ getqflist({title: 1})->assert_equal({title: 'test'})
- Xsetlist = function('setqflist', [[], ' '])
- Xsetlist({title: 'test'})
- getqflist({title: 1})->assert_equal({title: 'test'})
+ Xsetlist = function('setqflist', [[], ' '])
+ Xsetlist({title: 'test'})
+ getqflist({title: 1})->assert_equal({title: 'test'})
- var Len: func: number = function('len', ['word'])
- assert_equal(4, Len())
+ var Len: func: number = function('len', ['word'])
+ assert_equal(4, Len())
+
+ var RepeatFunc = function('repeat', ['o'])
+ assert_equal('ooooo', RepeatFunc(5))
+ END
+ CheckDefAndScriptSuccess(lines)
enddef
def Test_cmd_modifier()