summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-20 21:32:54 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-20 21:32:54 +0000
commitdd5893be34649482ed62525430fb8baa1ec273ce (patch)
treeb53ae04f33ac4c243c48a4650947d0792aa91c6c
parente615db06046312e74886fa1ef98feb5a9db2a7c3 (diff)
downloadvim-git-dd5893be34649482ed62525430fb8baa1ec273ce.tar.gz
patch 8.2.4167: Vim9: error message for old style importv8.2.4167
Problem: Vim9: error message for old style import. Solution: Use another error message. Add a test.
-rw-r--r--src/errors.h3
-rw-r--r--src/evalvars.c2
-rw-r--r--src/testdir/test_vim9_import.vim13
-rw-r--r--src/version.c2
4 files changed, 17 insertions, 3 deletions
diff --git a/src/errors.h b/src/errors.h
index 7ad1076df..3fd265f43 100644
--- a/src/errors.h
+++ b/src/errors.h
@@ -2966,8 +2966,7 @@ EXTERN char e_argument_name_shadows_existing_variable_str[]
INIT(= N_("E1167: Argument name shadows existing variable: %s"));
EXTERN char e_argument_already_declared_in_script_str[]
INIT(= N_("E1168: Argument already declared in the script: %s"));
-EXTERN char e_import_as_name_not_supported_here[]
- INIT(= N_("E1169: 'import * as {name}' not supported here"));
+// E1169 unused
EXTERN char e_cannot_use_hash_curly_to_start_comment[]
INIT(= N_("E1170: Cannot use #{ to start a comment"));
EXTERN char e_missing_end_block[]
diff --git a/src/evalvars.c b/src/evalvars.c
index 15999bc74..ca7e7e8cf 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2711,7 +2711,7 @@ eval_variable(
else
{
if (flags & EVAL_VAR_VERBOSE)
- emsg(_(e_import_as_name_not_supported_here));
+ semsg(_(e_expected_dot_after_name_str), name);
ret = FAIL;
}
}
diff --git a/src/testdir/test_vim9_import.vim b/src/testdir/test_vim9_import.vim
index b15d411c8..bacba2e8b 100644
--- a/src/testdir/test_vim9_import.vim
+++ b/src/testdir/test_vim9_import.vim
@@ -429,6 +429,19 @@ def Test_import_fails()
var that = foo
END
CheckScriptFailure(lines, 'E1060: Expected dot after name: foo')
+ lines =<< trim END
+ vim9script
+ import './Xfoo.vim' as foo
+ var that: any
+ that += foo
+ END
+ CheckScriptFailure(lines, 'E1060: Expected dot after name: foo')
+ lines =<< trim END
+ vim9script
+ import './Xfoo.vim' as foo
+ foo += 9
+ END
+ CheckScriptFailure(lines, 'E1060: Expected dot after name: foo')
lines =<< trim END
vim9script
diff --git a/src/version.c b/src/version.c
index eaeb0a1c3..27ee162fc 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4167,
+/**/
4166,
/**/
4165,