patch 8.2.2774: Vim9: cannot import an existing name even when using "as"
Problem: Vim9: cannot import an existing name even when using "as".
Solution: Do not check for an existing name when using "as". (closes #8113)
diff --git a/src/vim9script.c b/src/vim9script.c
index 796b7d1..583a8d4 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -600,7 +600,8 @@
}
else
{
- if (check_defined(name, len, cctx, FALSE) == FAIL)
+ if (as_name == NULL
+ && check_defined(name, len, cctx, FALSE) == FAIL)
goto erret;
imported = new_imported(gap != NULL ? gap