# HG changeset patch # User Bram Moolenaar # Date 1642715103 -3600 # Node ID b73e3617c1d65298052d13c45fc62fbd4af1f300 # Parent 0909c28d1fdebd0c1062fbdb85e79e130a3c2baf patch 8.2.4167: Vim9: error message for old style import Commit: https://github.com/vim/vim/commit/dd5893be34649482ed62525430fb8baa1ec273ce Author: Bram Moolenaar Date: Thu Jan 20 21:32:54 2022 +0000 patch 8.2.4167: Vim9: error message for old style import Problem: Vim9: error message for old style import. Solution: Use another error message. Add a test. diff --git a/src/errors.h b/src/errors.h --- a/src/errors.h +++ b/src/errors.h @@ -2966,8 +2966,7 @@ EXTERN char e_argument_name_shadows_exis 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 --- 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 --- 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 --- 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,