Hello,
I'm getting this error in my Vim 9 script in Windows GVim 8.2.2912:
Error detected while compiling C:/vim/Vimfiles/plugin/Test.vim[17]..function TestBrokenCall:
line 8:
E1013: Argument 3: type mismatch, expected string but got bool
Here is a simple duplication script:
vim9script
export def g:BrokenCall( lineNumber: number, insertMode: bool, templateToUse: string = 'defaultValue' ): void
echo lineNumber
echo insertMode
echo templateToUse
enddef
export def g:TestBrokenCall( line1: number, line2: number, templateName: string ): void
# This works
# call BrokenCall( line1, 0 )
# This results in
# Error detected while compiling C:/vim/Vimfiles/plugin/Test.vim[17]..function TestBrokenCall:
# line 8:
# E1013: Argument 3: type mismatch, expected string but got bool
call BrokenCall( line1, 0, templateName )
enddef
call TestBrokenCall(3, 5, 'ab')
Calling BrokenCall with just two arguments works, but passing in the third argument doesn't. The third argument can be a hard-coded string or the variable. Similarly, having BrokenCall contain a default value for the third parameter doesn't seem to matter, either.
Thank you,
Salman
--
Salman
I, too, shall something make and glory in the making.