Skip to content

Commit 9888e2e

Browse files
committed
Patch x: _* into x* (not x *)
1 parent e2c9dc0 commit 9888e2e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2344,7 +2344,7 @@ object Parsers {
23442344
in.sourcePos(uscoreStart),
23452345
future)
23462346
if sourceVersion == `future-migration` then
2347-
patch(source, Span(t.span.end, in.lastOffset), " *")
2347+
patch(source, Span(t.span.end, in.lastOffset), "*")
23482348
else if opStack.nonEmpty then
23492349
report.errorOrMigrationWarning(
23502350
em"""`_*` can be used only for last argument of method application.

tests/rewrites/rewrites3x.check

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import scala.{collection as coll, runtime as _, *}
2+
import coll.*
3+
4+
def f(xs: Int*) = xs.sum
5+
def test =
6+
f(List(1, 2, 3)*)
7+
8+
def g = { implicit (x: Int) =>
9+
x + 1
10+
}

0 commit comments

Comments
 (0)