1
0
forked from aniani/vim

patch 8.2.3091: Vim9: default argument expr. cannot use previous argument

Problem:    Vim9: default argument expression cannot use previous argument
Solution:   Correct argument index. (closes #8496)
This commit is contained in:
Bram Moolenaar
2021-07-03 18:56:53 +02:00
parent 00aaa512d5
commit e28d9b3bd4
4 changed files with 13 additions and 4 deletions

View File

@@ -452,6 +452,12 @@ def Test_call_default_args()
MyDefaultThird('->', 'xx', v:none)->assert_equal('->xxbb')
MyDefaultThird('->', v:none, 'yy')->assert_equal('->aayy')
MyDefaultThird('->', 'xx', 'yy')->assert_equal('->xxyy')
def DefArg(mandatory: any, optional = mandatory): string
return mandatory .. optional
enddef
DefArg(1234)->assert_equal('12341234')
DefArg("ok")->assert_equal('okok')
END
CheckDefAndScriptSuccess(lines)