Skip to content

Commit 190c7f4

Browse files
committed
Fix printing of given arguments
They printed as normal arguments before.
1 parent dee7e44 commit 190c7f4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,11 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
350350
keywordStr("'{") ~ toTextGlobal(args, ", ") ~ keywordStr("}")
351351
else if (!ctx.settings.YprintDebug.value && fun.hasType && fun.symbol == defn.InternalQuoted_exprSplice)
352352
keywordStr("${") ~ toTextGlobal(args, ", ") ~ keywordStr("}")
353+
else if (tree.getAttachment(untpd.ApplyGiven).isDefined && !homogenizedView)
354+
changePrec(InfixPrec) {
355+
toTextLocal(fun) ~ " given " ~
356+
(if (args.length == 1) toTextLocal(args.head) else "(" ~ toTextGlobal(args, ", ") ~ ")")
357+
}
353358
else
354359
toTextLocal(fun) ~ "(" ~ toTextGlobal(args, ", ") ~ ")"
355360
case tree: TypeApply =>

0 commit comments

Comments
 (0)