@@ -376,13 +376,13 @@ object Parsers {
376376 in.nextToken() // needed to ensure progress; otherwise we might cycle forever
377377 accept(SEMI )
378378
379- def rewriteNotice (additionalOption : String = " " ) = {
379+ def rewriteNotice (version : String = " 3.0 " , additionalOption : String = " " ) = {
380380 val optionStr = if (additionalOption.isEmpty) " " else " " ++ additionalOption
381- i " \n This construct can be rewritten automatically under $optionStr -rewrite -source 3.0 -migration. "
381+ i " \n This construct can be rewritten automatically under $optionStr -rewrite -source $version -migration. "
382382 }
383383
384384 def syntaxVersionError (option : String , span : Span ) =
385- syntaxError(em """ This construct is not allowed under $option. ${rewriteNotice(option)}""" , span)
385+ syntaxError(em """ This construct is not allowed under $option. ${rewriteNotice(" 3.0 " , option)}""" , span)
386386
387387 def rewriteToNewSyntax (span : Span = Span (in.offset)): Boolean = {
388388 if (in.newSyntax) {
@@ -2082,8 +2082,10 @@ object Parsers {
20822082 if isVarargSplice then
20832083 if sourceVersion.isAtLeast(`3.1`) then
20842084 report.errorOrMigrationWarning(
2085- em " The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead " ,
2085+ em " The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead ${rewriteNotice( " 3.1 " )} " ,
20862086 in.sourcePos(uscoreStart))
2087+ if sourceVersion == `3.1-migration` then
2088+ patch(source, Span (t.span.end, in.lastOffset), " *" )
20872089 else if opStack.nonEmpty then
20882090 report.errorOrMigrationWarning(
20892091 em """ `_*` can be used only for last argument of method application.
@@ -2160,7 +2162,7 @@ object Parsers {
21602162 // Don't error in non-strict mode, as the alternative syntax "implicit (x: T) => ... "
21612163 // is not supported by Scala2.x
21622164 report.errorOrMigrationWarning(
2163- s " This syntax is no longer supported; parameter needs to be enclosed in (...) ${rewriteNotice()}" ,
2165+ s " This syntax is no longer supported; parameter needs to be enclosed in (...) ${rewriteNotice(" 3.1 " )}" ,
21642166 source.atSpan(Span (start, in.lastOffset)))
21652167 in.nextToken()
21662168 val t = infixType()
0 commit comments