File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -789,8 +789,11 @@ ex_let(exarg_T *eap)
789789 {
790790 if (vim9script )
791791 {
792- // Vim9 declaration ":var name: type"
793- arg = vim9_declare_scriptvar (eap , arg );
792+ if (!ends_excmd2 (eap -> cmd , skipwhite (argend )))
793+ semsg (_ (e_trailing_arg ), argend );
794+ else
795+ // Vim9 declaration ":var name: type"
796+ arg = vim9_declare_scriptvar (eap , arg );
794797 }
795798 else
796799 {
Original file line number Diff line number Diff line change @@ -1290,6 +1290,8 @@ def Test_var_declaration()
12901290 other = 1234
12911291 g: other_var = other
12921292
1293+ var xyz: string # comment
1294+
12931295 # type is inferred
12941296 var s: dict = {[' a' ]: 222 }
12951297 def GetDictVal (key : any)
@@ -1365,7 +1367,7 @@ def Test_var_declaration_fails()
13651367 vim9script
13661368 var 9 var: string
13671369 END
1368- CheckScriptFailure (lines , ' E475 :' )
1370+ CheckScriptFailure (lines , ' E488 :' )
13691371
13701372 CheckDefFailure ([' var foo.bar = 2' ], ' E1087:' )
13711373 CheckDefFailure ([' var foo[3] = 2' ], ' E1087:' )
@@ -1617,6 +1619,11 @@ def Test_expr_error_no_assign()
16171619 echo x
16181620 END
16191621 CheckScriptFailureList (lines , [' E1154:' , ' E121:' ])
1622+
1623+ lines = << trim END
1624+ var x : string ' string'
1625+ END
1626+ CheckDefAndScriptFailure (lines , ' E488:' )
16201627enddef
16211628
16221629
Original file line number Diff line number Diff line change @@ -750,6 +750,8 @@ static char *(features[]) =
750750
751751static int included_patches [] =
752752{ /* Add new patch number below this line */
753+ /**/
754+ 2660 ,
753755/**/
754756 2659 ,
755757/**/
You can’t perform that action at this time.
0 commit comments