Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler/src/dotty/tools/dotc/typer/Migrations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ trait Migrations:
patch(
Span(ddef.mods.mods.last.span.end + 1, ddef.namePos.span.start), "given "
)
// remove empty parentheses
patch(
Span(ddef.namePos.span.end, ddef.tpt.span.start), ": "
)
ddef.tpt match
case refinedType: untpd.RefinedTypeTree =>
patch(refinedType.span.startPos, "(")
Expand Down
2 changes: 1 addition & 1 deletion tests/rewrites/implicit-to-given.check
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object Def:
val application = applicationTest(using 0)
val implicitArg: Int => Unit = (implicit a => applicationTest) // should not change

given refined(): (A {type B = Int}) = ???
given refined: (A {type B = Int}) = ???

class EmptyParamListClass()(using a: Int)
def emptyParamListTest() = new EmptyParamListClass()(using 0)
Loading