@@ -358,15 +358,26 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
358358 case block : Block =>
359359 blockToText(block)
360360 case If (cond, thenp, elsep) =>
361+ val isInline = tree.isInstanceOf [Trees .InlineIf [_]]
361362 changePrec(GlobalPrec ) {
362- keywordStr(" if " ) ~ toText(cond) ~ (keywordText(" then" ) provided ! cond.isInstanceOf [Parens ]) ~~ toText(thenp) ~ optText(elsep)(keywordStr(" else " ) ~ _)
363+ keywordStr(if (isInline) " inline if " else " if " ) ~
364+ toText(cond) ~ (keywordText(" then" ) provided ! cond.isInstanceOf [Parens ]) ~~
365+ toText(thenp) ~ optText(elsep)(keywordStr(" else " ) ~ _)
363366 }
364367 case Closure (env, ref, target) =>
365368 " closure(" ~ (toTextGlobal(env, " , " ) ~ " | " provided env.nonEmpty) ~
366369 toTextGlobal(ref) ~ (" :" ~ toText(target) provided ! target.isEmpty) ~ " )"
367370 case Match (sel, cases) =>
368- if (sel.isEmpty) blockText(cases)
369- else changePrec(GlobalPrec ) { toText(sel) ~ keywordStr(" match " ) ~ blockText(cases) }
371+ val isInline = tree.isInstanceOf [Trees .InlineMatch [_]]
372+ if (sel.isEmpty && ! isInline) blockText(cases)
373+ else changePrec(GlobalPrec ) {
374+ val selTxt : Text =
375+ if (isInline)
376+ if (sel.isEmpty) keywordStr(" implicit" )
377+ else keywordStr(" inline " ) ~ toText(sel)
378+ else toText(sel)
379+ selTxt ~ keywordStr(" match " ) ~ blockText(cases)
380+ }
370381 case CaseDef (pat, guard, body) =>
371382 keywordStr(" case " ) ~ inPattern(toText(pat)) ~ optText(guard)(keywordStr(" if " ) ~ _) ~ " => " ~ caseBlockText(body)
372383 case Labeled (bind, expr) =>
0 commit comments