File a.vim:
vim9script export def R(): tuple<string, string> return ('foo', 'bar') enddef
File b.vim
vim9script import autoload "./a.vim" def R() const [foo, bar] = a.R() echo foo bar enddef R()
Run :so in file b.vim, The result
Error detected while processing b.vim[7]..function <SNR>217_R:
line 1:
E1012: Type mismatch; expected list<any> but got tuple<string, string>
Unpack the tuple correctly. Such as this b.vim don't have error:
vim9script import autoload "./a.vim" const [foo, bar] = a.R() echo foo bar
Output: foo bar
gVim 9.1.2049
Windows 11
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #19080 as completed via eb577f9.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()