Closed dvogel closed 2 years ago
If you call the function through a reference it works:
vim9script
import "./demo9.vim"
const MyFunc = demo9.MyFunc
call MyFunc()
Surprisingly, when the reference is added call demo9.MyFunc()
works, too:
vim9script
import "./demo9.vim"
const MyFunc = demo9.MyFunc
call demo9.MyFunc()
If you call the function through a reference it works:
vim9script import "./demo9.vim" const MyFunc = demo9.MyFunc call MyFunc()
Surprisingly, when the reference is added
call demo9.MyFunc()
works, too:vim9script import "./demo9.vim" const MyFunc = demo9.MyFunc call demo9.MyFunc()
That was a mistake, it ignored the "demo9." part. If the local variable is given another name it fails again.
The last couple of patches should have fixed this.
The change in the import syntax was relying on the already implemented "* as Name" functionality, but it turns out that wasn't completely finished.
-- ZOOT: I'm afraid our life must seem very dull and quiet compared to yours. We are but eightscore young blondes, all between sixteen and nineteen-and-a-half, cut off in this castle, with no one to protect us. Oooh. It is a lonely life ... bathing ... dressing ... undressing ... making exciting underwear.... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- @.*** -- http://www.Moolenaar.net \\ /// \\ \\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\ help me help AIDS victims -- http://ICCF-Holland.org ///
Steps to reproduce
In
demo9.vim
:In
main.vim
:Run
vim --clean -u main.vim
, get error on line 3.Expected behaviour
I would expect the function to be found and called. From
:h call
:Removing
call
from line 3 does cause the function to be found and called as expected.Version of Vim
v8.2.4063
Environment
Debian, bash, xterm-256color
Logs and stack traces