comparison src/vim9compile.c @ 24283:bcfff560e089 v8.2.2682

patch 8.2.2682: Vim9: cannot find Name.Func from "import * as Name" Commit: https://github.com/vim/vim/commit/529fb5a5f62378bbaac00e1ed9b9c32c6e20c1b9 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 1 12:57:57 2021 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Thu, 01 Apr 2021 13:00:03 +0200
parents cabed216cc2f
children bbf4b3185554
comparison
equal deleted inserted replaced
24282:3c0286cbdea6 24283:bcfff560e089
2718 2718
2719 idx = find_exported(import->imp_sid, exp_name, &ufunc, &type, 2719 idx = find_exported(import->imp_sid, exp_name, &ufunc, &type,
2720 cctx, TRUE); 2720 cctx, TRUE);
2721 *p = cc; 2721 *p = cc;
2722 p = skipwhite(p); 2722 p = skipwhite(p);
2723 2723 *end = p;
2724 // TODO: what if it is a function? 2724
2725 if (idx < 0) 2725 if (idx < 0)
2726 {
2727 if (*p == '(' && ufunc != NULL)
2728 {
2729 generate_PUSHFUNC(cctx, ufunc->uf_name, import->imp_type);
2730 return OK;
2731 }
2726 return FAIL; 2732 return FAIL;
2727 *end = p; 2733 }
2728 2734
2729 generate_VIM9SCRIPT(cctx, ISN_LOADSCRIPT, 2735 generate_VIM9SCRIPT(cctx, ISN_LOADSCRIPT,
2730 import->imp_sid, 2736 import->imp_sid,
2731 idx, 2737 idx,
2732 type); 2738 type);