[vim/vim] Can't unpack a tuple in a function when get it from a function in another file (Issue #19080)

4 views
Skip to first unread message

Mao-Yining

unread,
Jan 4, 2026, 11:01:38 AM (2 days ago) Jan 4
to vim/vim, Subscribed
mao-yining created an issue (vim/vim#19080)

Steps to reproduce

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>

Expected behaviour

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

Version of Vim

gVim 9.1.2049

Environment

Windows 11

Logs and stack traces


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19080@github.com>

Christian Brabandt

unread,
5:17 AM (8 minutes ago) 5:17 AM
to vim/vim, Subscribed

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.Message ID: <vim/vim/issue/19080/issue_event/21873158951@github.com>

Reply all
Reply to author
Forward
0 new messages