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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user