File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -654,3 +654,5 @@ EXTERN char e_legacy_must_be_followed_by_command[]
654654 INIT (= N_ ("E1234: legacy must be followed by a command" ));
655655EXTERN char e_function_reference_is_not_set []
656656 INIT (= N_ ("E1235: Function reference is not set" ));
657+ EXTERN char e_cannot_use_str_itself_it_is_imported_with_star []
658+ INIT (= N_ ("E1236: Cannot use %s itself, it is imported with '*'" ));
Original file line number Diff line number Diff line change @@ -3260,6 +3260,12 @@ set_var_const(
32603260 semsg (_ (e_redefining_imported_item_str ), name );
32613261 goto failed ;
32623262 }
3263+ if (import -> imp_flags & IMP_FLAGS_STAR )
3264+ {
3265+ semsg (_ (e_cannot_use_str_itself_it_is_imported_with_star ),
3266+ name );
3267+ goto failed ;
3268+ }
32633269 sv = ((svar_T * )si -> sn_var_vals .ga_data ) + import -> imp_var_vals_idx ;
32643270
32653271 where .wt_variable = TRUE;
Original file line number Diff line number Diff line change @@ -1477,6 +1477,21 @@ def Test_vim9_import_export()
14771477 delete (' Xvim9_script' )
14781478enddef
14791479
1480+ def Test_import_star_fails ()
1481+ writefile ([], ' Xfoo.vim' )
1482+ var lines = << trim END
1483+ import * as foo from ' /tmp/foo.vim'
1484+ foo = ' bar'
1485+ END
1486+ CheckDefAndScriptFailure2 (lines , ' E1094:' , ' E1236: Cannot use foo itself' )
1487+ lines = << trim END
1488+ vim9script
1489+ import * as foo from ' /tmp/foo.vim'
1490+ var that = foo
1491+ END
1492+ CheckScriptFailure (lines , ' E1029: Expected '' .'' ' )
1493+ enddef
1494+
14801495def Test_import_as ()
14811496 var export_lines = << trim END
14821497 vim9script
Original file line number Diff line number Diff line change @@ -755,6 +755,8 @@ static char *(features[]) =
755755
756756static int included_patches [] =
757757{ /* Add new patch number below this line */
758+ /**/
759+ 3411 ,
758760/**/
759761 3410 ,
760762/**/
You can’t perform that action at this time.
0 commit comments