Skip to content

Commit

Permalink
Patch x: _* into x* (not x *)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Nov 1, 2023
1 parent e2c9dc0 commit 9888e2e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions tests/rewrites/rewrites3x.check
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 9888e2e

Please sign in to comment.