diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 48653ad96197..d0498c2b90a6 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -2344,7 +2344,7 @@ object Parsers { in.sourcePos(uscoreStart), future) if sourceVersion == `future-migration` then - patch(source, Span(t.span.end, in.lastOffset), " *") + patch(source, Span(t.span.end, in.lastOffset), "*") else if opStack.nonEmpty then report.errorOrMigrationWarning( em"""`_*` can be used only for last argument of method application. @@ -2973,12 +2973,6 @@ object Parsers { case p => p - private def warnStarMigration(p: Tree) = - report.errorOrMigrationWarning( - em"The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead", - in.sourcePos(startOffset(p)), - from = future) - /** InfixPattern ::= SimplePattern {id [nl] SimplePattern} */ def infixPattern(): Tree = diff --git a/tests/rewrites/rewrites3x.check b/tests/rewrites/rewrites3x.check new file mode 100644 index 000000000000..0e7e0193bdd3 --- /dev/null +++ b/tests/rewrites/rewrites3x.check @@ -0,0 +1,10 @@ +import scala.{collection as coll, runtime as _, *} +import coll.* + +def f(xs: Int*) = xs.sum +def test = + f(List(1, 2, 3)*) + +def g = { implicit (x: Int) => + x + 1 +}