From 529fb5a5f62378bbaac00e1ed9b9c32c6e20c1b9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 1 Apr 2021 12:57:57 +0200 Subject: patch 8.2.2682: Vim9: cannot find Name.Func from "import * as Name" 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. --- src/vim9compile.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/vim9compile.c') 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, -- cgit v1.2.1