Skip to content

Commit 662bd4c

Browse files
committed
Make Formatting#explained take an implicit function type.
1 parent d3ebb98 commit 662bd4c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/core/Decorators.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ object Decorators {
204204
* give more info about type variables and to disambiguate where needed.
205205
*/
206206
def ex(args: Any*)(implicit ctx: Context): String =
207-
explained(implicit ctx => em(args: _*))
207+
explained(em(args: _*))
208208
}
209209

210210
implicit class ArrayInterpolator[T <: AnyRef](val arr: Array[T]) extends AnyVal {

compiler/src/dotty/tools/dotc/printing/Formatting.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ object Formatting {
252252
* ex"disambiguate $tpe1 and $tpe2"
253253
* ```
254254
*/
255-
def explained(op: Context => String)(implicit ctx: Context): String = {
255+
def explained(op: given Context => String)(implicit ctx: Context): String = {
256256
val seen = new Seen
257-
val msg = op(explainCtx(seen))
257+
val msg = op given explainCtx(seen)
258258
val addendum = explanations(seen)
259259
if (addendum.isEmpty) msg else msg ++ "\n\n" ++ addendum
260260
}

0 commit comments

Comments
 (0)