summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-04-01 12:57:57 +0200
committerBram Moolenaar <Bram@vim.org>2021-04-01 12:57:57 +0200
commit529fb5a5f62378bbaac00e1ed9b9c32c6e20c1b9 (patch)
treee1065950c21303ce05a5ababf3812ff00e0bb533 /src/vim9compile.c
parent12be734faffe1da04dfa9098e73abaa864204bc5 (diff)
downloadvim-git-8.2.2682.tar.gz
patch 8.2.2682: Vim9: cannot find Name.Func from "import * as Name"v8.2.2682
Problem: Vim9: cannot find Name.Func from "import * as Name". (Alexander Goussas) Solution: When no variable found try finding a function. (closes #8045) Check that the function was exported.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 72387610d..fa73de23d 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2720,11 +2720,17 @@ compile_load_scriptvar(
cctx, TRUE);
*p = cc;
p = skipwhite(p);
+ *end = p;
- // TODO: what if it is a function?
if (idx < 0)
+ {
+ if (*p == '(' && ufunc != NULL)
+ {
+ generate_PUSHFUNC(cctx, ufunc->uf_name, import->imp_type);
+ return OK;
+ }
return FAIL;
- *end = p;
+ }
generate_VIM9SCRIPT(cctx, ISN_LOADSCRIPT,
import->imp_sid,